big update all menus

This commit is contained in:
Wian Drs
2026-08-07 09:16:13 +07:00
parent 75342dc7b7
commit e7575ba1c0
101 changed files with 3451 additions and 89 deletions
+44
View File
@@ -0,0 +1,44 @@
<?php
namespace App\Jobs;
use App\Models\NasMikrotik;
use App\Services\Nas\MikrotikHealthService;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Throwable;
class CheckMikrotikConnection implements ShouldBeUnique, ShouldQueue
{
use Queueable;
public int $tries = 1;
public int $timeout = 25;
public int $uniqueFor = 240;
public function __construct(public int $mikrotikId)
{
$this->onQueue(config('nas.health.queue', 'nas-health'));
}
public function uniqueId(): string
{
return (string) $this->mikrotikId;
}
public function handle(MikrotikHealthService $health): void
{
$mikrotik = NasMikrotik::whereKey($this->mikrotikId)->where('status', 'active')->first();
if (! $mikrotik) {
return;
}
try {
$health->check($mikrotik);
} catch (Throwable) {
// Health service has persisted the offline state and next backoff time.
}
}
}