mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-07 08:52:35 +00:00
refactoring - remove unused code
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
namespace App\Jobs\Queue;
|
||||
|
||||
use App\Enums\QueueStatus;
|
||||
use App\Events\Broadcast;
|
||||
use App\Jobs\Job;
|
||||
use App\Models\Queue;
|
||||
|
||||
@ -30,20 +29,10 @@ public function handle(): void
|
||||
);
|
||||
$this->worker->status = QueueStatus::RUNNING;
|
||||
$this->worker->save();
|
||||
event(
|
||||
new Broadcast('deploy-queue-finished', [
|
||||
'queue' => $this->worker,
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
public function failed(): void
|
||||
{
|
||||
$this->worker->delete();
|
||||
event(
|
||||
new Broadcast('deploy-queue-failed', [
|
||||
'queue' => $this->worker,
|
||||
])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Jobs\Queue;
|
||||
|
||||
use App\Events\Broadcast;
|
||||
use App\Jobs\Job;
|
||||
use App\Models\Queue;
|
||||
|
||||
@ -18,20 +17,10 @@ public function __construct(Queue $worker)
|
||||
public function handle(): void
|
||||
{
|
||||
$logs = $this->worker->server->processManager()->handler()->getLogs($this->worker->log_file);
|
||||
event(
|
||||
new Broadcast('get-logs-finished', [
|
||||
'id' => $this->worker->id,
|
||||
'logs' => $logs,
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
public function failed(): void
|
||||
{
|
||||
event(
|
||||
new Broadcast('get-logs-failed', [
|
||||
'message' => __('Failed to download the logs!'),
|
||||
])
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Jobs\Queue;
|
||||
|
||||
use App\Events\Broadcast;
|
||||
use App\Jobs\Job;
|
||||
use App\Models\Queue;
|
||||
|
||||
@ -47,22 +46,11 @@ public function handle(): void
|
||||
}
|
||||
$this->worker->status = $this->successStatus;
|
||||
$this->worker->save();
|
||||
event(
|
||||
new Broadcast('manage-queue-finished', [
|
||||
'queue' => $this->worker,
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
public function failed(): void
|
||||
{
|
||||
$this->worker->status = $this->failStatus;
|
||||
$this->worker->save();
|
||||
event(
|
||||
new Broadcast('manage-queue-failed', [
|
||||
'message' => $this->failMessage,
|
||||
'queue' => $this->worker,
|
||||
])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Jobs\Queue;
|
||||
|
||||
use App\Enums\QueueStatus;
|
||||
use App\Events\Broadcast;
|
||||
use App\Jobs\Job;
|
||||
use App\Models\Queue;
|
||||
|
||||
@ -20,22 +19,11 @@ public function handle(): void
|
||||
{
|
||||
$this->worker->server->processManager()->handler()->delete($this->worker->id, $this->worker->site_id);
|
||||
$this->worker->delete();
|
||||
event(
|
||||
new Broadcast('remove-queue-finished', [
|
||||
'id' => $this->worker->id,
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
public function failed(): void
|
||||
{
|
||||
$this->worker->status = QueueStatus::FAILED;
|
||||
$this->worker->save();
|
||||
event(
|
||||
new Broadcast('remove-queue-failed', [
|
||||
'message' => __('Failed to delete worker!'),
|
||||
'id' => $this->worker->id,
|
||||
])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user