Skip to content

Commit

Permalink
cause BANE to shutdown gracefully when ctrl+C'd. reslove #38
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHancock committed May 5, 2018
1 parent af97f5c commit 8f98336
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion AegeanTools/BANE.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,12 @@ def filter_mc_sharemem(filename, step_size, box_size, cores, shape, dobkg=True):
args.append((filename, region, step_size, box_size, shape, dobkg))

pool = multiprocessing.Pool(processes=cores)
pool.map(_sf2, args)
try:
pool.map_async(_sf2, args).get(timeout=10000000)
except KeyboardInterrupt:
logging.error("Caught keyboard interrupt")
pool.close()
sys.exit(1)
pool.close()
pool.join()

Expand Down

0 comments on commit 8f98336

Please sign in to comment.