From 8d709b43660690d59abb92cdbbd2663db450eac1 Mon Sep 17 00:00:00 2001 From: velvettear Date: Thu, 24 Mar 2022 13:14:42 +0100 Subject: [PATCH] minor optimizations --- libs/blinky.js | 6 +++--- libs/server.js | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/blinky.js b/libs/blinky.js index 79bd655..32311ac 100644 --- a/libs/blinky.js +++ b/libs/blinky.js @@ -40,7 +40,7 @@ async function setActive(active) { { blinkstick: 'strip' } ); } catch (err) { - logger.error(err); + logger.error('[BLINKY] ' + err); } } @@ -90,7 +90,7 @@ async function setStatus(pedals) { } } } catch (err) { - logger.error(err); + logger.error('[BLINKY] ' + err); } } @@ -104,7 +104,7 @@ async function setBypass(bypassActive) { } await httpPOST(global.config.blinky.host, global.config.blinky.port, 'pulse', { blinkstick: 'square', color: '#660000' }); } catch (err) { - logger.error(err); + logger.error('[BLINKY] ' + err); } } diff --git a/libs/server.js b/libs/server.js index f435abe..b6cd2c4 100644 --- a/libs/server.js +++ b/libs/server.js @@ -70,9 +70,7 @@ function handleRequests() { } function endRequest(request, response, msg, code) { - if (code == undefined) { - code = 200; - } + code = code || 200; var object = { request: request, code: code