From cc6945996c0a763056171b2a845ba5aec23cc34d Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 26 Oct 2016 18:16:08 -0400 Subject: [PATCH] Reverted map, added chunksize --- app/scheduler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/scheduler.py b/app/scheduler.py index b5510514..06acb337 100644 --- a/app/scheduler.py +++ b/app/scheduler.py @@ -60,8 +60,7 @@ def process_pending_tasks(): if tasks.count() > 0: pool = ThreadPool(tasks.count()) - for task in tasks: - pool.apply_async(process, args=(task, )) + pool.map(process, tasks, chunksize=1) pool.close() pool.join()