Skip to content

A self-hosted media server and file management system

fix(experiment): horizon restart method does not work

aminnausin84e2ccb376b8
diff --git a/app/Services/Server/QueueControlService.php b/app/Services/Server/QueueControlService.php
index 7a28403f..055a2cf0 100644
--- a/app/Services/Server/QueueControlService.php
+++ b/app/Services/Server/QueueControlService.php
@@ -10,10 +10,13 @@ class QueueControlService {
public function restart(): void {
try {
if (config('queue.default') === 'redis' && $this->horizonIsRunning()) {
- Artisan::call('horizon:terminate');
+ dispatch(function () {
+ Artisan::call('horizon:terminate');
+ })->onQueue('high');
}
} catch (\Throwable $th) {
Log::error("Unable to restart Horizon", ["error" => $th->getMessage()]);
+ throw $th;
}
}