added keyword args instead of postional for execute monitor logic

This commit is contained in:
tpv committed 2026-06-30 19:37:01 -07:00
1 parent 8f86e85c50
commit 6025393ad4
2 files changed
+9 -5

No files matched your search

+6 -4
View File
@@ -60,12 +60,11 @@ async def add_products_to_database(
new_price is not None and new_price < old_price
)
set_on_insert = {"discoveredDate": datetime.now(timezone.utc)}
if price_dropped:
document["status"] = STATUS_PENDING
document["priceBeforeDrop"] = old_price
set_on_insert = {"discoveredDate": datetime.now(timezone.utc)}
if not price_dropped:
else:
set_on_insert["status"] = STATUS_PENDING
ops.append(
@@ -79,7 +78,10 @@ async def add_products_to_database(
try:
await collection.bulk_write(ops, ordered=False)
except PyMongoError:
LOGGER.exception(f"{category_identifier} - failed to add products to database")
LOGGER.exception(
"failed to add products to database",
extra={"category": category_identifier},
)
raise