fix(22d): commit outer transaction in scrape_catalog_objects orchestrator #342
1 changed files with 9 additions and 0 deletions
|
|
@ -449,6 +449,15 @@ async def scrape_catalog_objects(
|
|||
else:
|
||||
stats["failed"] += 1
|
||||
|
||||
# Commit outer transaction: SAVEPOINT (`begin_nested`) releases внутри loop,
|
||||
# но outer tx остаётся autobegin'd — без commit() все UPDATE'ы откатятся
|
||||
# при db.close() в Celery task.
|
||||
try:
|
||||
db.commit()
|
||||
except Exception:
|
||||
db.rollback()
|
||||
raise
|
||||
|
||||
logger.info(
|
||||
"scrape_catalog_objects done: processed=%d succeeded=%d failed=%d skipped=%d",
|
||||
stats["processed"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue