mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 12:23:48 +00:00
fix(upgrade): wait for new version before showing success
Expose the running Coolify version on /api/health and only treat an upgrade as complete once that version meets the target. Parse upgrade status in a shared service, start the update after the Livewire response, and keep polling when the instance is still on the old version.
This commit is contained in:
@@ -292,13 +292,20 @@ class OtherController extends Controller
|
||||
|
||||
#[OA\Get(
|
||||
summary: 'Healthcheck',
|
||||
description: 'Healthcheck endpoint.',
|
||||
description: 'Healthcheck endpoint. Includes the running Coolify version in the X-Coolify-Version header.',
|
||||
path: '/health',
|
||||
operationId: 'healthcheck',
|
||||
responses: [
|
||||
new OA\Response(
|
||||
response: 200,
|
||||
description: 'Healthcheck endpoint.',
|
||||
headers: [
|
||||
new OA\Header(
|
||||
header: 'X-Coolify-Version',
|
||||
description: 'Currently running Coolify version.',
|
||||
schema: new OA\Schema(type: 'string', example: '4.3.1'),
|
||||
),
|
||||
],
|
||||
content: new OA\MediaType(
|
||||
mediaType: 'text/html',
|
||||
schema: new OA\Schema(type: 'string'),
|
||||
@@ -316,6 +323,6 @@ class OtherController extends Controller
|
||||
)]
|
||||
public function healthcheck(Request $request)
|
||||
{
|
||||
return 'OK';
|
||||
return response('OK')->header('X-Coolify-Version', (string) config('constants.coolify.version'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user