feat: enhance horizon:manage command with worker restart check

- Added a new option `--can-i-restart-this-worker` to the `horizon:manage` command.
- Implemented logic to check if the current worker can be restarted based on running jobs in the ApplicationDeploymentQueue.
- Refactored the command to include a new method `canIRestartThisWorker` for better code organization.
- Removed unnecessary dump statement from the CustomJobRepository.
This commit is contained in:
Andras Bacsai
2025-01-10 15:48:23 +01:00
parent 765e1ea04b
commit a3648901ed
2 changed files with 27 additions and 2 deletions

View File

@@ -31,7 +31,6 @@ class CustomJobRepository extends RedisJobRepository implements CustomJobReposit
$this->getRecent()->each(function ($job) use ($jobs, $status, $worker) {
if ($job->status === $status) {
if ($worker) {
dump($job);
if ($job->worker !== $worker) {
return;
}