Previously translate_log_for_active_languages and translate_summary_for_active_languages added every successful translation to the session and called session.commit() once at the end. A single bad row (DB error, constraint violation, encoding mismatch) rolled back the whole batch — losing all the languages that had succeeded. Wrap each row in session.begin_nested() so a per-row failure only loses that one row. Track succeeded/failed counts and log them at the end — escalating to error if zero succeeded out of N attempted, so total failure surfaces in monitoring instead of just N warning lines. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _helpers.py | ||
| _market_context.py | ||
| ai_log_job.py | ||
| email_digest_job.py | ||
| indicator_summary_job.py | ||
| market_job.py | ||
| news_job.py | ||
| rollup_job.py | ||
| universe_flush_job.py | ||