Skip to content

Commit

Permalink
only pop if in there to avoid exception
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxiBoether committed Sep 24, 2024
1 parent e356273 commit 9f5178f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modyn/evaluator/internal/grpc/evaluator_grpc_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,12 @@ def cleanup_evaluations(
self._evaluation_process_dict.pop(evaluation_id)

for e_id in evaluation_ids:
self._evaluation_dict.pop(e_id)
self._evaluation_data_dict.pop(e_id)
self._evaluation_data_dict_locks.pop(e_id)
if e_id in self._evaluation_dict:
self._evaluation_dict.pop(e_id)
if e_id in self._evaluation_data_dict:
self._evaluation_data_dict.pop(e_id)
if e_id in self._evaluation_data_dict_locks:
self._evaluation_data_dict_locks.pop(e_id)

gc.collect()
return EvaluationCleanupResponse(succeeded=list(sorted(already_cleaned + not_yet_cleaned)))

0 comments on commit 9f5178f

Please sign in to comment.