Skip to content

Commit

Permalink
Fix issue openwpm#1068: add extra guard, check for store_record_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadMahdiJavid committed Nov 22, 2023
1 parent 553b1f3 commit 57adefc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openwpm/storage/storage_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ async def finalize_visit_id(
self.logger.info("Awaiting all tasks for visit_id %d", visit_id)
for task in self.store_record_tasks[visit_id]:
await task

if visit_id not in self.store_record_tasks:
self.logger.error(
"visit_id %d, is already awaited, skipping...",
visit_id,
)
return None

del self.store_record_tasks[visit_id]
self.logger.debug(
"Awaited all tasks for visit_id %d while finalizing", visit_id
Expand Down

0 comments on commit 57adefc

Please sign in to comment.