feat(scheduling): persist and claim scheduled job occurrences

Add database-backed schedule states and deliveries so distributed schedulers publish each occurrence once, queue jobs claim executions atomically, and stale occurrences are cleaned up.
This commit is contained in:
Andras Bacsai
2026-09-18 13:56:40 +02:00
parent 8a2457da93
commit 19949a6f6f
12 changed files with 692 additions and 75 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Models;
class ScheduledJobDelivery extends BaseModel
{
protected $fillable = [
'uuid',
'schedule_key',
'scheduled_for',
'job_type',
'resource_id',
'payload',
'status',
'claim_token',
'enqueued_at',
'started_at',
];
protected function casts(): array
{
return [
'scheduled_for' => 'immutable_datetime',
'payload' => 'array',
'enqueued_at' => 'immutable_datetime',
'started_at' => 'immutable_datetime',
];
}
}