mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-28 02:06:37 -04:00
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:
@@ -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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user