mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
clean
This commit is contained in:
parent
2daecd34f1
commit
0a98415e25
3 changed files with 1 additions and 7 deletions
|
|
@ -52,7 +52,6 @@ class CelerySchedulerConfig(SchedulerConfig):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# Union type for all scheduler configs with discriminator
|
|
||||||
SchedulerConfigUnion = Annotated[
|
SchedulerConfigUnion = Annotated[
|
||||||
InlineSchedulerConfig | CelerySchedulerConfig,
|
InlineSchedulerConfig | CelerySchedulerConfig,
|
||||||
Field(discriminator="type"),
|
Field(discriminator="type"),
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@ class InlineSchedulerImpl(Scheduler):
|
||||||
job["started_at"] = datetime.fromisoformat(job["started_at"])
|
job["started_at"] = datetime.fromisoformat(job["started_at"])
|
||||||
if job.get("completed_at"):
|
if job.get("completed_at"):
|
||||||
job["completed_at"] = datetime.fromisoformat(job["completed_at"])
|
job["completed_at"] = datetime.fromisoformat(job["completed_at"])
|
||||||
# Deserialize JobStatus enum
|
|
||||||
job["status"] = JobStatus(job["status"])
|
job["status"] = JobStatus(job["status"])
|
||||||
|
|
||||||
self._jobs[job["job_id"]] = job
|
self._jobs[job["job_id"]] = job
|
||||||
|
|
@ -171,8 +170,6 @@ class InlineSchedulerImpl(Scheduler):
|
||||||
await self._save_job_to_storage(job)
|
await self._save_job_to_storage(job)
|
||||||
|
|
||||||
# Execute the job based on job_type
|
# 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)
|
result = await self._execute_job(job)
|
||||||
|
|
||||||
# Mark as completed
|
# Mark as completed
|
||||||
|
|
@ -215,9 +212,8 @@ class InlineSchedulerImpl(Scheduler):
|
||||||
# Check if a custom executor is registered for this job type
|
# Check if a custom executor is registered for this job type
|
||||||
if job_type in self._job_executors:
|
if job_type in self._job_executors:
|
||||||
executor = self._job_executors[job_type]
|
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}")
|
raise ValueError(f"No executor registered for job type: {job_type}")
|
||||||
|
|
||||||
async def get_job_info(self, job_id: str) -> dict:
|
async def get_job_info(self, job_id: str) -> dict:
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,6 @@ class InlineSchedulerImpl(Scheduler):
|
||||||
|
|
||||||
for value in stored_values:
|
for value in stored_values:
|
||||||
job = json.loads(value)
|
job = json.loads(value)
|
||||||
# Deserialize datetime strings back to datetime objects
|
|
||||||
job["created_at"] = datetime.fromisoformat(job["created_at"])
|
job["created_at"] = datetime.fromisoformat(job["created_at"])
|
||||||
if job.get("started_at"):
|
if job.get("started_at"):
|
||||||
job["started_at"] = datetime.fromisoformat(job["started_at"])
|
job["started_at"] = datetime.fromisoformat(job["started_at"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue