From 89b8d473dee2556220ebd95de3e1c87c810e94ad Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 6 May 2024 21:00:18 +0200 Subject: [PATCH] Daily sync: add extra logging --- app/tasks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/tasks.py b/app/tasks.py index c2be40ab..4feb4dcc 100644 --- a/app/tasks.py +++ b/app/tasks.py @@ -71,13 +71,21 @@ def import_product_db( """ logger.info(f"Launching import_product_db ({flavor})") existing_codes = set(db.execute(select(Product.code)).scalars()) - logger.info("Number of existing codes: %d", len(existing_codes)) + logger.info(f"OP: number of existing codes: {len(existing_codes)}") + existing_codes_flavor = set( + db.execute(select(Product.code).where(Product.source == flavor)).scalars() + ) + logger.info( + f"OP: number of existing codes from {flavor}: {len(existing_codes_flavor)}" + ) + dataset = ProductDataset( flavor=flavor, dataset_type=DatasetType.jsonl, force_download=True, download_newer=True, ) + logger.info(f"Dataset size: {dataset.count()}") added_count = 0 updated_count = 0