Catch ctrl+c to commit before quitting.

This commit is contained in:
voussoir 2020-02-13 20:27:28 -08:00
parent 9b0d8fdfa0
commit cb4b6a3882

View file

@ -535,7 +535,10 @@ def update_argparse(args):
else: else:
bigchunk_range = pixel_range_to_bigchunk_range(*coordinates) bigchunk_range = pixel_range_to_bigchunk_range(*coordinates)
chunks = download_bigchunk_range(*bigchunk_range, threads=args.threads) chunks = download_bigchunk_range(*bigchunk_range, threads=args.threads)
insert_chunks(chunks) try:
insert_chunks(chunks)
except KeyboardInterrupt:
sql.commit()
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers() subparsers = parser.add_subparsers()