Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Aug 5, 2024
1 parent f1e5525 commit 03fb7ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,20 @@ async def insert_batch(batch_queue: Queue, error_queue: Queue):
except OperationalError as e:
logger.error({"error": e})
await asyncio.gather(
*[error_queue.put(convert_stg_to_kafka_report(m)) for m in batch]
*[
error_queue.put(convert_stg_to_kafka_report(m).model_dump())
for m in batch
]
)
await asyncio.sleep(5)
except Exception as e:
logger.error({"error": e})
logger.debug(f"Traceback: \n{traceback.format_exc()}")
await asyncio.gather(
*[error_queue.put(convert_stg_to_kafka_report(m)) for m in batch]
*[
error_queue.put(convert_stg_to_kafka_report(m).model_dump())
for m in batch
]
)
await asyncio.sleep(5)

Expand Down

0 comments on commit 03fb7ab

Please sign in to comment.