feat(seeder): conditionally dispatch StartProxy action based on proxy check result
This commit is contained in:
parent
423cf8f67d
commit
bd9f3d9a69
1 changed files with 5 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Actions\Proxy\CheckProxy;
|
||||
use App\Actions\Proxy\StartProxy;
|
||||
use App\Data\ServerMetadata;
|
||||
use App\Enums\ProxyStatus;
|
||||
|
|
@ -124,7 +125,10 @@ public function run(): void
|
|||
$server->settings->is_reachable = true;
|
||||
$server->settings->is_usable = true;
|
||||
$server->settings->save();
|
||||
StartProxy::dispatch($server);
|
||||
$shouldStart = CheckProxy::run($server);
|
||||
if ($shouldStart) {
|
||||
StartProxy::dispatch($server);
|
||||
}
|
||||
if ($server->isSentinelEnabled()) {
|
||||
CheckAndStartSentinelJob::dispatch($server);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue