Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: update last online with old function

Andras Bacsaia2b6a61c4a2a
diff --git a/app/Actions/Docker/GetContainersStatus.php b/app/Actions/Docker/GetContainersStatus.php
index 26bd9f0b42..a08056837f 100644
--- a/app/Actions/Docker/GetContainersStatus.php
+++ b/app/Actions/Docker/GetContainersStatus.php
@@ -107,6 +107,8 @@ class GetContainersStatus
$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 @@ class GetContainersStatus
$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 @@ class GetContainersStatus
$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 @@ class GetContainersStatus
if ($statusFromDb !== $containerStatus) {
// ray('Updating status: ' . $containerStatus);
$service->update(['status' => $containerStatus]);
+ } else {
+ $service->update(['last_online_at' => now()]);
}
}
}
diff --git a/app/Actions/Server/ServerCheck.php b/app/Actions/Server/ServerCheck.php
index c72f129d39..1dae03fd90 100644
--- a/app/Actions/Server/ServerCheck.php
+++ b/app/Actions/Server/ServerCheck.php
@@ -14,7 +14,7 @@ use App\Models\Service;
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
diff --git a/app/Models/Server.php b/app/Models/Server.php
index 0fcfd89ab9..3076308ade 100644
--- a/app/Models/Server.php
+++ b/app/Models/Server.php
@@ -1238,7 +1238,7 @@ $schema://$host {
StartSentinel::run($this, true);
}
} catch (\Throwable $e) {
- return handleError($e, $this);
+ return handleError($e);
}
}