fix(restart): reset restart count when resource is manually stopped (#7784)

This commit is contained in:
Andras Bacsai
2025-12-27 15:22:26 +01:00
committed by GitHub
2 changed files with 15 additions and 0 deletions

View File

@@ -55,6 +55,14 @@ class StopApplication
return $e->getMessage(); 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); ServiceStatusChanged::dispatch($application->environment->project->team->id);
} }
} }

View File

@@ -28,6 +28,13 @@ class StopDatabase
$this->stopContainer($database, $database->uuid, 30); $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) { if ($dockerCleanup) {
CleanupDocker::dispatch($server, false, false); CleanupDocker::dispatch($server, false, false);
} }