diff --git a/src/bulk_normalization.py b/src/bulk_normalization.py index 5beb4e5..4f1d279 100644 --- a/src/bulk_normalization.py +++ b/src/bulk_normalization.py @@ -307,17 +307,17 @@ async def insert_data_v3(batch: list[Message], error_queue: Queue): ) await session.commit() except (OperationalError, IntegrityError) as e: + logger.error({"error": e}) for message in batch: await error_queue.put(message.model_dump()) - logger.error({"error": e}) logger.info(f"error_qsize={error_queue.qsize()}, {message=}") except Exception as e: + logger.error({"error": e}) + logger.debug(f"Traceback: \n{traceback.format_exc()}") for message in batch: await error_queue.put(message.model_dump()) - logger.error({"error": e}) - logger.debug(f"Traceback: \n{traceback.format_exc()}") logger.info(f"error_qsize={error_queue.qsize()}, {message=}")