From 3c29b69bb69a36e44384c66d06ff4513dba46511 Mon Sep 17 00:00:00 2001 From: extreme4all <40169115+extreme4all@users.noreply.github.com> Date: Sun, 14 Jul 2024 00:59:28 +0200 Subject: [PATCH] skip dupe check --- src/main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 326a28d..e794431 100644 --- a/src/main.py +++ b/src/main.py @@ -33,7 +33,11 @@ class ReportedDoesNotExist(PlayerDoesNotExist): ... -async def check_duplicate_report(report_queue: Queue, valid_report_queue: Queue): +async def check_duplicate_report( + report_queue: Queue, + valid_report_queue: Queue, + skip: bool = False, +): while True: # Check if both queues are empty if report_queue.empty(): @@ -44,6 +48,10 @@ async def check_duplicate_report(report_queue: Queue, valid_report_queue: Queue) msg: StgReportCreate = await report_queue.get() report_queue.task_done() + if skip: + await valid_report_queue.put(msg) + continue + try: # Acquire an asynchronous database session session: AsyncSession = await get_session() @@ -230,6 +238,7 @@ async def main(): check_duplicate_report( report_queue=report_queue, valid_report_queue=valid_report_queue, + skip=True, ) ) asyncio.create_task(insert_batch(valid_report_queue=valid_report_queue))