fix: update last online with old function
This commit is contained in:
parent
e69b0ca1a9
commit
a2b6a61c4a
3 changed files with 11 additions and 2 deletions
|
|
@ -107,6 +107,8 @@ public function handle(Server $server, ?Collection $containers = null, ?Collecti
|
|||
$statusFromDb = $preview->status;
|
||||
if ($statusFromDb !== $containerStatus) {
|
||||
$preview->update(['status' => $containerStatus]);
|
||||
} else {
|
||||
$preview->update(['last_online_at' => now()]);
|
||||
}
|
||||
} else {
|
||||
//Notify user that this container should not be there.
|
||||
|
|
@ -118,6 +120,8 @@ public function handle(Server $server, ?Collection $containers = null, ?Collecti
|
|||
$statusFromDb = $application->status;
|
||||
if ($statusFromDb !== $containerStatus) {
|
||||
$application->update(['status' => $containerStatus]);
|
||||
} else {
|
||||
$application->update(['last_online_at' => now()]);
|
||||
}
|
||||
} else {
|
||||
//Notify user that this container should not be there.
|
||||
|
|
@ -160,7 +164,10 @@ public function handle(Server $server, ?Collection $containers = null, ?Collecti
|
|||
$statusFromDb = $database->status;
|
||||
if ($statusFromDb !== $containerStatus) {
|
||||
$database->update(['status' => $containerStatus]);
|
||||
} else {
|
||||
$database->update(['last_online_at' => now()]);
|
||||
}
|
||||
|
||||
if ($isPublic) {
|
||||
$foundTcpProxy = $this->containers->filter(function ($value, $key) use ($uuid) {
|
||||
if ($this->server->isSwarm()) {
|
||||
|
|
@ -202,6 +209,8 @@ public function handle(Server $server, ?Collection $containers = null, ?Collecti
|
|||
if ($statusFromDb !== $containerStatus) {
|
||||
// ray('Updating status: ' . $containerStatus);
|
||||
$service->update(['status' => $containerStatus]);
|
||||
} else {
|
||||
$service->update(['last_online_at' => now()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
use App\Models\ServiceApplication;
|
||||
use App\Models\ServiceDatabase;
|
||||
use App\Notifications\Container\ContainerRestarted;
|
||||
use Arr;
|
||||
use Illuminate\Support\Arr;
|
||||
use Lorisleiva\Actions\Concerns\AsAction;
|
||||
|
||||
class ServerCheck
|
||||
|
|
|
|||
|
|
@ -1238,7 +1238,7 @@ public function restartSentinel(bool $async = true)
|
|||
StartSentinel::run($this, true);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
return handleError($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue