Queue cron runs through workers

This commit is contained in:
Jeppe Bundgaard
2026-07-13 20:03:39 +02:00
parent 403f93e62c
commit 026492c3bd
7 changed files with 316 additions and 13 deletions
@@ -11,6 +11,7 @@ it('wires cron workers through schema, CLI, scheduler, and superuser routes', fu
expect($schema)->toContain('CREATE TABLE IF NOT EXISTS cron_worker_state');
expect($schema)->toContain('last_heartbeat_at');
expect($schema)->toContain('last_stale_run_count');
expect($schema)->toContain('force_run TINYINT(1) NOT NULL DEFAULT 0');
expect($worker)->toContain('CRON_WORKER_POLL_SECONDS');
expect($worker)->toContain('CRON_WORKER_HEARTBEAT_SECONDS');
@@ -19,6 +20,11 @@ it('wires cron workers through schema, CLI, scheduler, and superuser routes', fu
expect($worker)->toContain('runDue($this->source)');
expect($scheduler)->toContain('function markExpiredRunningRuns');
expect($scheduler)->toContain('function queueTaskRun');
expect($scheduler)->toContain('function queuedRuns');
expect($scheduler)->toContain('function runQueuedRun');
expect($scheduler)->toContain("WHERE status = 'queued'");
expect($scheduler)->toContain("SET status = 'running'");
expect($scheduler)->toContain("r.status = 'timed_out'");
expect($scheduler)->toContain('s.current_run_id = NULL');
@@ -27,6 +33,8 @@ it('wires cron workers through schema, CLI, scheduler, and superuser routes', fu
expect($route)->toContain('/superuser/cron/workers');
expect($route)->toContain('/superuser/cron/workers/deploy');
expect($route)->toContain('queueTaskRun(');
expect($route)->toContain('$response->success($run, 202)');
expect($route)->toContain('superuser_cron_view');
expect($route)->toContain('superuser_cron_manage');
expect($route)->toContain('superuser_coolify_manage');
@@ -34,6 +42,8 @@ it('wires cron workers through schema, CLI, scheduler, and superuser routes', fu
expect($manager)->toContain("private const CRON_WORKER_APP = 'cron'");
expect($manager)->toContain("private const CRON_WORKER_START_COMMAND = 'php index.php run cron-worker'");
expect($manager)->toContain('deployCronWorkerAfterApiDeployment');
expect($manager)->toContain('cronWorkerAutoprovisionRequired');
expect($manager)->toContain('cron_worker_autoprovision_disabled');
expect($manager)->toContain('cron_worker_deploy_failed');
expect($manager)->toContain('auto_deploy = 0');
});