mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-07 04:23:46 +00:00
fix(queue): route scheduled jobs through crons helper
Centralize scheduled job queue selection with crons_queue() and use it for scheduler, task, and database backup jobs so cloud runs on crons while self-hosted stays on high.
This commit is contained in:
@@ -608,6 +608,23 @@ function deployment_queue(): string
|
||||
return isCloud() ? 'deployments' : 'high';
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the queue used for scheduled jobs — the scheduler dispatcher, scheduled tasks and
|
||||
* scheduled database backups, whether triggered automatically or manually.
|
||||
*
|
||||
* On cloud these jobs run on a dedicated `crons` queue so they can be drained by an isolated
|
||||
* Horizon worker pool; self-hosted keeps them on the shared `high` queue. Routing is decided
|
||||
* by `isCloud()` (config-based), so the dispatching process needs no special env — only the
|
||||
* worker must be configured to drain `crons`.
|
||||
*
|
||||
* IMPORTANT: on cloud a worker MUST include `crons` in its `HORIZON_QUEUES`, otherwise these
|
||||
* jobs are never processed.
|
||||
*/
|
||||
function crons_queue(): string
|
||||
{
|
||||
return isCloud() ? 'crons' : 'high';
|
||||
}
|
||||
|
||||
function translate_cron_expression($expression_to_validate): string
|
||||
{
|
||||
if (isset(VALID_CRON_STRINGS[$expression_to_validate])) {
|
||||
|
||||
Reference in New Issue
Block a user