From 1e9a8b213050ee529494aea36450aa7c6359f4e9 Mon Sep 17 00:00:00 2001 From: Markus-Rost <37275477+Markus-Rost@users.noreply.github.com> Date: Wed, 24 Jul 2024 21:03:16 +0200 Subject: [PATCH] fix logic errors --- dashboard/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboard/index.js b/dashboard/index.js index c094d03e..e5b7e190 100644 --- a/dashboard/index.js +++ b/dashboard/index.js @@ -295,7 +295,7 @@ const server = createServer( (req, res) => { let site = reqURL.searchParams.get('site'); console.log( '- Dashboard: Requesting RcGcDb debug dump' + ( site ? ' for ' + site : '.' ) ); return new Promise( (resolve, reject) => { - let id = Date.now(); + let id = Date.now().toString(); if ( site ) id = '-1+' + id; let timeout = setTimeout( () => { listenerMap.delete(id); @@ -314,6 +314,7 @@ const server = createServer( (req, res) => { /** @param {String} body */ function write(body) { return res.write( body, error => { + if ( !error ) return; listenerMap.delete(id); clearTimeout(timeout); reject(error);