feat(scheduler): delete orphaned jobs and block editing of unregistered jobs
Adds deleteOrphanedJobs() to clean up stale job_keys during ensureSystemJobs, and prevents editing jobs that are no longer registered in the runtime registry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,13 @@ class ScheduledJobService
|
||||
}
|
||||
$this->scheduledJobRepository->updateJobMeta((int) $existing['id'], $normalized);
|
||||
}
|
||||
|
||||
$this->scheduledJobRepository->deleteOrphanedJobs(array_keys($definitions));
|
||||
}
|
||||
|
||||
public function isRegistered(string $jobKey): bool
|
||||
{
|
||||
return $this->scheduledJobRegistry->get($jobKey) !== null;
|
||||
}
|
||||
|
||||
public function listPaged(array $filters): array
|
||||
|
||||
Reference in New Issue
Block a user