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
commit 083d745d70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -55,6 +55,14 @@ public function handle(Application $application, bool $previewDeployments = fals
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 @@ public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|St
$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);
} }