mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 12:03:54 +02:00
Fix frozen jobs
This commit is contained in:
@@ -185,12 +185,12 @@ def cleanup_indexing_jobs(
|
|||||||
# batch of documents indexed
|
# batch of documents indexed
|
||||||
current_db_time = get_db_current_time(db_session=db_session)
|
current_db_time = get_db_current_time(db_session=db_session)
|
||||||
time_since_update = current_db_time - index_attempt.time_updated
|
time_since_update = current_db_time - index_attempt.time_updated
|
||||||
if time_since_update.seconds > 3 * 60 * 60:
|
if time_since_update.total_seconds() > 60 * 60:
|
||||||
existing_jobs[index_attempt.id].cancel()
|
existing_jobs[index_attempt.id].cancel()
|
||||||
mark_run_failed(
|
mark_run_failed(
|
||||||
db_session=db_session,
|
db_session=db_session,
|
||||||
index_attempt=index_attempt,
|
index_attempt=index_attempt,
|
||||||
failure_reason="Indexing run frozen - no updates in 3 hours. "
|
failure_reason="Indexing run frozen - no updates in an hour. "
|
||||||
"The run will be re-attempted at next scheduled indexing time.",
|
"The run will be re-attempted at next scheduled indexing time.",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user