mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 10:15:40 +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:
1 parent
e2199f1223
commit
fcd63f40eb
5 files changed
+41
-17
No files matched your search
@@ -37,18 +37,7 @@ class ScheduledJobManager implements ShouldQueue
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->onQueue($this->determineQueue());
|
||||
}
|
||||
|
||||
/**
|
||||
* On cloud this job runs on a dedicated `crons` queue so it can be drained by an isolated
|
||||
* Horizon worker pool; self-hosted keeps it 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` via `HORIZON_QUEUES`.
|
||||
*/
|
||||
private function determineQueue(): string
|
||||
{
|
||||
return isCloud() ? 'crons' : 'high';
|
||||
$this->onQueue(crons_queue());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user