File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -301,7 +301,6 @@ def refresh_status_and_store_results(self) -> None:
301301 """Process this external job and update status/results"""
302302 try :
303303 api_client = InferenceAPIClient ()
304- # model_version = ModelVersion.objects.get(classification_type=self.inference_job.classification_type)
305304 model_version = self .inference_job .model_version
306305
307306 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:
314313 # Handle completion or failure
315314 if new_status == ExternalJobStatus .COMPLETED :
316315 self .store_results (response .get ("results" ))
317- # self.completed_at = timezone.now() # completed in mark_completed called in store_results
318316 self .save ()
319317
320318 except Exception as e :
Original file line number Diff line number Diff line change @@ -22,3 +22,19 @@ def create_periodic_tasks(sender, **kwargs):
2222 name = "Process inference queue (6pm-7am)" ,
2323 task = "inference.tasks.process_inference_job_queue" ,
2424 )
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():
1818 return "Queue processing already in progress"
1919
2020 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-
2521 # Look for pending jobs first
2622 pending_jobs = InferenceJob .objects .filter (status = InferenceJobStatus .PENDING )
2723
You can’t perform that action at this time.
0 commit comments