File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,6 @@ def refresh_status_and_store_results(self) -> None:
301
301
"""Process this external job and update status/results"""
302
302
try :
303
303
api_client = InferenceAPIClient ()
304
- # model_version = ModelVersion.objects.get(classification_type=self.inference_job.classification_type)
305
304
model_version = self .inference_job .model_version
306
305
307
306
response = api_client .get_job_status (model_version .api_identifier , self .external_job_id )
@@ -314,7 +313,6 @@ def refresh_status_and_store_results(self) -> None:
314
313
# Handle completion or failure
315
314
if new_status == ExternalJobStatus .COMPLETED :
316
315
self .store_results (response .get ("results" ))
317
- # self.completed_at = timezone.now() # completed in mark_completed called in store_results
318
316
self .save ()
319
317
320
318
except Exception as e :
Original file line number Diff line number Diff line change @@ -22,3 +22,19 @@ def create_periodic_tasks(sender, **kwargs):
22
22
name = "Process inference queue (6pm-7am)" ,
23
23
task = "inference.tasks.process_inference_job_queue" ,
24
24
)
25
+
26
+ # Create schedule the weekend
27
+ weekend_crontab , _ = CrontabSchedule .objects .get_or_create (
28
+ minute = "*/5" ,
29
+ hour = "*" ,
30
+ day_of_week = "0,6" ,
31
+ day_of_month = "*" ,
32
+ month_of_year = "*" ,
33
+ )
34
+
35
+ # Create the periodic task if it doesn't exist
36
+ PeriodicTask .objects .get_or_create (
37
+ crontab = weekend_crontab ,
38
+ name = "Process inference queue (Weekends)" ,
39
+ task = "inference.tasks.process_inference_job_queue" ,
40
+ )
Original file line number Diff line number Diff line change @@ -18,10 +18,6 @@ def process_inference_job_queue():
18
18
return "Queue processing already in progress"
19
19
20
20
try :
21
- # 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()
24
-
25
21
# Look for pending jobs first
26
22
pending_jobs = InferenceJob .objects .filter (status = InferenceJobStatus .PENDING )
27
23
You can’t perform that action at this time.
0 commit comments