fix: update last online with old function
This commit is contained in:
@@ -107,6 +107,8 @@ class GetContainersStatus
|
|||||||
$statusFromDb = $preview->status;
|
$statusFromDb = $preview->status;
|
||||||
if ($statusFromDb !== $containerStatus) {
|
if ($statusFromDb !== $containerStatus) {
|
||||||
$preview->update(['status' => $containerStatus]);
|
$preview->update(['status' => $containerStatus]);
|
||||||
|
} else {
|
||||||
|
$preview->update(['last_online_at' => now()]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Notify user that this container should not be there.
|
//Notify user that this container should not be there.
|
||||||
@@ -118,6 +120,8 @@ class GetContainersStatus
|
|||||||
$statusFromDb = $application->status;
|
$statusFromDb = $application->status;
|
||||||
if ($statusFromDb !== $containerStatus) {
|
if ($statusFromDb !== $containerStatus) {
|
||||||
$application->update(['status' => $containerStatus]);
|
$application->update(['status' => $containerStatus]);
|
||||||
|
} else {
|
||||||
|
$application->update(['last_online_at' => now()]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Notify user that this container should not be there.
|
//Notify user that this container should not be there.
|
||||||
@@ -160,7 +164,10 @@ class GetContainersStatus
|
|||||||
$statusFromDb = $database->status;
|
$statusFromDb = $database->status;
|
||||||
if ($statusFromDb !== $containerStatus) {
|
if ($statusFromDb !== $containerStatus) {
|
||||||
$database->update(['status' => $containerStatus]);
|
$database->update(['status' => $containerStatus]);
|
||||||
|
} else {
|
||||||
|
$database->update(['last_online_at' => now()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isPublic) {
|
if ($isPublic) {
|
||||||
$foundTcpProxy = $this->containers->filter(function ($value, $key) use ($uuid) {
|
$foundTcpProxy = $this->containers->filter(function ($value, $key) use ($uuid) {
|
||||||
if ($this->server->isSwarm()) {
|
if ($this->server->isSwarm()) {
|
||||||
@@ -202,6 +209,8 @@ class GetContainersStatus
|
|||||||
if ($statusFromDb !== $containerStatus) {
|
if ($statusFromDb !== $containerStatus) {
|
||||||
// ray('Updating status: ' . $containerStatus);
|
// ray('Updating status: ' . $containerStatus);
|
||||||
$service->update(['status' => $containerStatus]);
|
$service->update(['status' => $containerStatus]);
|
||||||
|
} else {
|
||||||
|
$service->update(['last_online_at' => now()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ use App\Models\Service;
|
|||||||
use App\Models\ServiceApplication;
|
use App\Models\ServiceApplication;
|
||||||
use App\Models\ServiceDatabase;
|
use App\Models\ServiceDatabase;
|
||||||
use App\Notifications\Container\ContainerRestarted;
|
use App\Notifications\Container\ContainerRestarted;
|
||||||
use Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Lorisleiva\Actions\Concerns\AsAction;
|
use Lorisleiva\Actions\Concerns\AsAction;
|
||||||
|
|
||||||
class ServerCheck
|
class ServerCheck
|
||||||
|
@@ -1238,7 +1238,7 @@ $schema://$host {
|
|||||||
StartSentinel::run($this, true);
|
StartSentinel::run($this, true);
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user