aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgrab-queue10
1 files changed, 7 insertions, 3 deletions
diff --git a/grab-queue b/grab-queue
index dbdc030..bfeaf40 100755
--- a/grab-queue
+++ b/grab-queue
@@ -271,13 +271,13 @@ if __name__ == "__main__":
parser.set_defaults(progress=True)
args = parser.parse_args()
+ # Initialize our dumper
+ queue = GrabQueue(args)
+
# Dispatch
try:
start_time = time.time()
- # Initialize our dumper
- queue = GrabQueue(args)
-
# Record date and invocation
logs = ''.join(args.dest) + os.sep + 'logs' + os.sep
queue.download.ensuredir(logs)
@@ -298,6 +298,10 @@ if __name__ == "__main__":
elapsed = open(logs + 'grab-queue.duration', 'a')
elapsed.write(str(start_time) + '\t' + str(end_time) + '\t' + duration)
elapsed.close()
+ except MemoryError as e:
+ print(e)
+ queue.dump_stats()
+ exit(1)
except (FileNotFoundError, KeyboardInterrupt, subprocess.CalledProcessError) as e:
print(e)
exit(1)