2024-11-03 08:02:14 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
2024-11-07 08:13:19 +00:00
|
|
|
use App\Actions\Server\ResourcesCheck;
|
2024-11-03 08:02:14 +00:00
|
|
|
use App\Actions\Server\ServerCheck;
|
|
|
|
|
use App\Models\Server;
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
|
|
|
|
class ServerCheckNewJob implements ShouldBeEncrypted, ShouldQueue
|
|
|
|
|
{
|
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
|
|
|
|
|
public $tries = 1;
|
|
|
|
|
|
|
|
|
|
public $timeout = 60;
|
|
|
|
|
|
|
|
|
|
public function __construct(public Server $server) {}
|
|
|
|
|
|
|
|
|
|
public function handle()
|
|
|
|
|
{
|
|
|
|
|
try {
|
2024-11-03 13:53:44 +00:00
|
|
|
ServerCheck::run($this->server);
|
2024-11-07 08:13:19 +00:00
|
|
|
ResourcesCheck::dispatch($this->server);
|
2025-01-07 14:31:43 +00:00
|
|
|
} catch (\Throwable $e) {
|
2024-11-03 08:02:14 +00:00
|
|
|
return handleError($e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|