From 3bc7fb6800512926521f40e2c862fcee6ec1ac3a Mon Sep 17 00:00:00 2001 From: BOHA Date: Tue, 24 Mar 2026 11:24:51 +0100 Subject: [PATCH] fix: lock heartbeat every 10s, timeout after 30s (was 2min/5min) --- src/admin/pages/OfferDetail.tsx | 2 +- src/routes/admin/quotations.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/admin/pages/OfferDetail.tsx b/src/admin/pages/OfferDetail.tsx index b94bb25..fdb0f14 100644 --- a/src/admin/pages/OfferDetail.tsx +++ b/src/admin/pages/OfferDetail.tsx @@ -267,7 +267,7 @@ export default function OfferDetail() { heartbeatRef.current = setInterval(() => { apiFetch(`${API_BASE}/offers/${id}/heartbeat`, { method: 'POST' }).catch(() => {}) - }, 2 * 60 * 1000) // every 2 minutes + }, 10 * 1000) // every 10 seconds return () => { if (heartbeatRef.current) clearInterval(heartbeatRef.current) diff --git a/src/routes/admin/quotations.ts b/src/routes/admin/quotations.ts index 9fe6cbe..3b47f78 100644 --- a/src/routes/admin/quotations.ts +++ b/src/routes/admin/quotations.ts @@ -17,7 +17,7 @@ import { getNextOfferNumber, } from '../../services/offers.service'; -const LOCK_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes — lock expires if no heartbeat +const LOCK_TIMEOUT_MS = 30 * 1000; // 30 seconds — lock expires if no heartbeat export default async function quotationsRoutes(fastify: FastifyInstance): Promise {