Skip to content

Commit aa04e27

Browse files
author
Vladimir Kotal
committed
remove stale comment and cleanup pool of workers on KeyboardInterrupt
1 parent ba73b44 commit aa04e27

File tree

1 file changed

+3
-3
lines changed
  • opengrok-tools/src/main/python/opengrok_tools

1 file changed

+3
-3
lines changed

opengrok-tools/src/main/python/opengrok_tools/sync.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ def main():
153153
"opengrok-sync.lock"))
154154
try:
155155
with lock.acquire(timeout=0):
156-
pool = Pool(processes=int(args.workers))
157-
158156
if args.projects:
159157
dirs_to_process = args.projects
160158
logger.debug("Processing directories: {}".
@@ -186,10 +184,12 @@ def main():
186184
cmds_base.append(cmd_base)
187185

188186
# Map the commands into pool of workers so they can be processed.
187+
pool = Pool(processes=int(args.workers))
189188
try:
190189
cmds_base_results = pool.map(worker, cmds_base, 1)
191190
except KeyboardInterrupt:
192-
# XXX lock.release() or return 1 ?
191+
pool.close()
192+
pool.terminate()
193193
sys.exit(1)
194194
else:
195195
for cmds_base in cmds_base_results:

0 commit comments

Comments
 (0)