@@ -156,7 +156,9 @@ def check_task_completion(task):
156156 return True , task_status
157157
158158
159- def process_task_completion (task , task_status , tasks_file , dataset_file ):
159+ def process_task_completion (
160+ task , task_status , tasks_file , dataset_file , collector_config
161+ ):
160162
161163 jobname = task ["tags" ]["jobname" ]
162164 taskid = task ["tags" ]["taskid" ]
@@ -181,8 +183,10 @@ def process_task_completion(task, task_status, tasks_file, dataset_file):
181183
182184 taskset_handler .update_task_status (task ["id" ], tasks_file , task_status )
183185
184- batch_handler .delete_pool (poolname )
185- batch_handler .delete_job (jobname )
186+ if not collector_config ["keeppools" ]:
187+ batch_handler .delete_pool (poolname )
188+ if not collector_config ["keepjobs" ]:
189+ batch_handler .delete_job (jobname )
186190
187191
188192def process_tasks_multitask (tasks_file , dataset_file , collector_config ):
@@ -233,7 +237,9 @@ def process_tasks_multitask(tasks_file, dataset_file, collector_config):
233237 for task in running_tasks [:]:
234238 task_has_completed , task_status = check_task_completion (task )
235239 if task_has_completed :
236- process_task_completion (task , task_status , tasks_file , dataset_file )
240+ process_task_completion (
241+ task , task_status , tasks_file , dataset_file , collector_config
242+ )
237243 completed_tasks .append (task )
238244 running_tasks .remove (task )
239245 num_running_tasks -= 1
0 commit comments