Fix: SSH Multiplexing for Jobs

This commit is contained in:
peaklabs-dev
2024-09-17 15:31:05 +02:00
parent 175f4b9ae1
commit ea3501ada6
4 changed files with 34 additions and 15 deletions

View File

@@ -43,7 +43,7 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
return isDev() ? 1 : 3;
}
public function __construct(public Server $server, public bool $isManualCheck = false) {}
public function __construct(public Server $server) {}
public function middleware(): array
{
@@ -58,9 +58,6 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
public function handle()
{
try {
// Enable SSH multiplexing for autonomous checks, disable for manual checks
config()->set('constants.ssh.mux_enabled', !$this->isManualCheck);
$this->applications = $this->server->applications();
$this->databases = $this->server->databases();
$this->services = $this->server->services()->get();
@@ -96,7 +93,7 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
private function serverStatus()
{
['uptime' => $uptime] = $this->server->validateConnection($this->isManualCheck);
['uptime' => $uptime] = $this->server->validateConnection(false);
if ($uptime) {
if ($this->server->unreachable_notification_sent === true) {
$this->server->update(['unreachable_notification_sent' => false]);