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:
2026-04-13 14:13:09 +02:00
parent 1c784efd5c
commit 312d43d9d9
7 changed files with 69 additions and 0 deletions

View File

@@ -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