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(restart): reset restart count when resource is manually stopped

Andras Bacsai75d8ebe80338
diff --git a/app/Actions/Application/StopApplication.php b/app/Actions/Application/StopApplication.php
index 94651a3c1b..e86e30f045 100644
--- a/app/Actions/Application/StopApplication.php
+++ b/app/Actions/Application/StopApplication.php
@@ -55,6 +55,14 @@ class StopApplication
return $e->getMessage();
}
}
+
+ // Reset restart tracking when application is manually stopped
+ $application->update([
+ 'restart_count' => 0,
+ 'last_restart_at' => null,
+ 'last_restart_type' => null,
+ ]);
+
ServiceStatusChanged::dispatch($application->environment->project->team->id);
}
}
diff --git a/app/Actions/Database/StopDatabase.php b/app/Actions/Database/StopDatabase.php
index c024c14e12..4dde509abb 100644
--- a/app/Actions/Database/StopDatabase.php
+++ b/app/Actions/Database/StopDatabase.php
@@ -28,6 +28,13 @@ class StopDatabase
$this->stopContainer($database, $database->uuid, 30);
+ // Reset restart tracking when database is manually stopped
+ $database->update([
+ 'restart_count' => 0,
+ 'last_restart_at' => null,
+ 'last_restart_type' => null,
+ ]);
+
if ($dockerCleanup) {
CleanupDocker::dispatch($server, false, false);
}