From 289480c95478a28408159e5b50b82e08ddf9af0b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 19 Mar 2024 10:24:23 +0100 Subject: [PATCH] feat: able to run scheduler/horizon programatically --- app/Console/Commands/Horizon.php | 21 +++++++++++++++++++ app/Console/Commands/Scheduler.php | 21 +++++++++++++++++++ config/coolify.php | 2 ++ config/sentry.php | 2 +- config/version.php | 2 +- .../etc/s6-overlay/s6-rc.d/horizon/run | 2 +- .../s6-overlay/s6-rc.d/scheduler-worker/run | 2 +- versions.json | 2 +- 8 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 app/Console/Commands/Horizon.php create mode 100644 app/Console/Commands/Scheduler.php diff --git a/app/Console/Commands/Horizon.php b/app/Console/Commands/Horizon.php new file mode 100644 index 000000000..8dd64a246 --- /dev/null +++ b/app/Console/Commands/Horizon.php @@ -0,0 +1,21 @@ +info('Horizon is enabled. Starting.'); + $this->call('horizon'); + exit(0); + } else { + exit(0); + } + } +} diff --git a/app/Console/Commands/Scheduler.php b/app/Console/Commands/Scheduler.php new file mode 100644 index 000000000..eab623802 --- /dev/null +++ b/app/Console/Commands/Scheduler.php @@ -0,0 +1,21 @@ +info('Scheduler is enabled. Starting.'); + $this->call('schedule:work'); + exit(0); + } else { + exit(0); + } + } +} diff --git a/config/coolify.php b/config/coolify.php index 69ec23146..a6d6d8581 100644 --- a/config/coolify.php +++ b/config/coolify.php @@ -12,4 +12,6 @@ 'is_windows_docker_desktop' => env('IS_WINDOWS_DOCKER_DESKTOP', false), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), 'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper:latest'), + 'is_horizon_enabled' => env('HORIZON_ENABLED', true), + 'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true), ]; diff --git a/config/sentry.php b/config/sentry.php index 5d46ba7f3..b4c1aa5f4 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.240', + 'release' => '4.0.0-beta.241', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index c7e1008fc..f00cd2d57 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@