Skip to content

Commit 6365c10

Browse files
committed
Reevaluate progress for only PENDING InferenceJobs
1 parent ddc3dee commit 6365c10

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

inference/tasks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ def process_inference_job_queue():
1919

2020
try:
2121
# Reevaluate progress and update status of all inference jobs that are not currently queued
22-
for job in InferenceJob.objects.exclude(status=InferenceJobStatus.QUEUED):
23-
job.reevaluate_progress_and_update_status()
22+
# for job in InferenceJob.objects.exclude(status=InferenceJobStatus.QUEUED):
23+
# job.reevaluate_progress_and_update_status()
2424

2525
# Look for pending jobs first
2626
pending_jobs = InferenceJob.objects.filter(status=InferenceJobStatus.PENDING)
2727

2828
if pending_jobs.exists():
29-
# Process pending jobs
29+
# Refresh and process pending jobs
3030
for job in pending_jobs:
3131
job.refresh_external_jobs_status_and_store_results()
32+
job.reevaluate_progress_and_update_status()
3233
else:
3334
# If no pending jobs, try to initiate a queued job
3435
queued_job = (

0 commit comments

Comments
 (0)