mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
@ -18,9 +18,14 @@ public function handle(): void
|
||||
ServerStatus::READY,
|
||||
ServerStatus::DISCONNECTED,
|
||||
])->chunk(50, function ($servers) {
|
||||
$dispatchTime = now();
|
||||
/** @var Server $server */
|
||||
foreach ($servers as $server) {
|
||||
dispatch(function () use ($server) {
|
||||
dispatch(function () use ($server, $dispatchTime) {
|
||||
// check connection if dispatch time is less than 5 minutes ago
|
||||
if ($dispatchTime->diffInMinutes(now()) > 5) {
|
||||
return;
|
||||
}
|
||||
$server->checkConnection();
|
||||
})->onConnection('ssh');
|
||||
}
|
||||
|
Reference in New Issue
Block a user