fix(appstore): резервный REST-опрос прогресса установки (не зависать при потере WS)
All checks were successful
Deploy to Production / Trigger production update (push) Successful in 8s
All checks were successful
Deploy to Production / Trigger production update (push) Successful in 8s
Мастер установки получал прогресс только по WebSocket; при потерянном событии (или долгом docker compose up с тяжёлыми образами) UI замирал на последнем шаге. Добавлен поллинг /operations раз в 3с как фолбэк. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -73,11 +73,13 @@ export function useInstalledApp(id: number) {
|
||||
});
|
||||
}
|
||||
|
||||
export function useAppOperations(id: number) {
|
||||
export function useAppOperations(id: number, pollMs?: number) {
|
||||
return useQuery({
|
||||
queryKey: appstoreKeys.operations(id),
|
||||
queryFn: () => apiClient.get<{ items: AppOperation[] }>(`/api/appstore/apps/${id}/operations`).then((r) => r.items),
|
||||
enabled: id > 0,
|
||||
// Резервный опрос (когда задан) — прогресс не зависит только от WebSocket.
|
||||
refetchInterval: pollMs && pollMs > 0 ? pollMs : false,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user