added keyword args instead of postional for execute monitor logic
This commit is contained in:
1 parent
8f86e85c50
commit
6025393ad4
2 files changed
+9
-5
No files matched your search
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user