diff --git a/app/Actions/Application/StopApplication.php b/app/Actions/Application/StopApplication.php index 94651a3c1..e86e30f04 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 c024c14e1..4dde509ab 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); }