diff --git a/llama_stack/providers/utils/job_scheduler/config.py b/llama_stack/providers/utils/job_scheduler/config.py index 325387cfd..d8eba89fb 100644 --- a/llama_stack/providers/utils/job_scheduler/config.py +++ b/llama_stack/providers/utils/job_scheduler/config.py @@ -52,7 +52,6 @@ class CelerySchedulerConfig(SchedulerConfig): ) -# Union type for all scheduler configs with discriminator SchedulerConfigUnion = Annotated[ InlineSchedulerConfig | CelerySchedulerConfig, Field(discriminator="type"), diff --git a/llama_stack/providers/utils/job_scheduler/inline/scheduler.py b/llama_stack/providers/utils/job_scheduler/inline/scheduler.py index b53621128..b253b8a59 100644 --- a/llama_stack/providers/utils/job_scheduler/inline/scheduler.py +++ b/llama_stack/providers/utils/job_scheduler/inline/scheduler.py @@ -80,7 +80,6 @@ class InlineSchedulerImpl(Scheduler): job["started_at"] = datetime.fromisoformat(job["started_at"]) if job.get("completed_at"): job["completed_at"] = datetime.fromisoformat(job["completed_at"]) - # Deserialize JobStatus enum job["status"] = JobStatus(job["status"]) self._jobs[job["job_id"]] = job @@ -171,8 +170,6 @@ class InlineSchedulerImpl(Scheduler): await self._save_job_to_storage(job) # Execute the job based on job_type - # This is where job-specific logic would be called - # For now, we'll simulate a simple job execution result = await self._execute_job(job) # Mark as completed @@ -215,9 +212,8 @@ class InlineSchedulerImpl(Scheduler): # Check if a custom executor is registered for this job type if job_type in self._job_executors: executor = self._job_executors[job_type] - return await executor(job_data) # Call the registered executor + return await executor(job_data) - # No executor registered for this job type raise ValueError(f"No executor registered for job type: {job_type}") async def get_job_info(self, job_id: str) -> dict: diff --git a/src/llama_stack/providers/utils/job_scheduler/inline/scheduler.py b/src/llama_stack/providers/utils/job_scheduler/inline/scheduler.py index 401bb0d27..68d201604 100644 --- a/src/llama_stack/providers/utils/job_scheduler/inline/scheduler.py +++ b/src/llama_stack/providers/utils/job_scheduler/inline/scheduler.py @@ -74,7 +74,6 @@ class InlineSchedulerImpl(Scheduler): for value in stored_values: job = json.loads(value) - # Deserialize datetime strings back to datetime objects job["created_at"] = datetime.fromisoformat(job["created_at"]) if job.get("started_at"): job["started_at"] = datetime.fromisoformat(job["started_at"])