From e7b552b47697b3074e4656fb46d7408a72da4db0 Mon Sep 17 00:00:00 2001 From: facundoolano Date: Thu, 29 Feb 2024 13:37:22 -0300 Subject: [PATCH] fix: close sse client before attempting a reconnection --- site/site.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/site.go b/site/site.go index 538d674..a39a491 100644 --- a/site/site.go +++ b/site/site.go @@ -399,7 +399,8 @@ function newSSE() { } eventSource.onerror = function (event) { console.error('An error occurred:', event); - setTimeout(newSSE, 1000) + eventSource.close(); + setTimeout(newSSE, 5000) }; } newSSE();`