about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-11-25 15:31:45 +0100
committerThibaut Girka <thib@sitedethib.com>2020-11-25 15:31:45 +0100
commite71b16ae2b5623dc664c79ffa7d96282af662c78 (patch)
treedb77dc96f03d7e9b51e33b379dd1f1b9bebc0343 /streaming
parent24696458bf22c8529b49f89b2791e3e07583b7e0 (diff)
parent41b38b027396d50cac2cf995f2b5830c2cf592fa (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `Gemfile.lock`:
  glitch-soc-only dependency textually too close to updated upstream
  dependencies. Updated to upsteam dependencies.
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/streaming/index.js b/streaming/index.js
index ee4100696..d17ac64e9 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -230,13 +230,13 @@ const startWorker = (workerId) => {
   const FALSE_VALUES = [
     false,
     0,
-    "0",
-    "f",
-    "F",
-    "false",
-    "FALSE",
-    "off",
-    "OFF"
+    '0',
+    'f',
+    'F',
+    'false',
+    'FALSE',
+    'off',
+    'OFF',
   ];
 
   /**
@@ -378,6 +378,8 @@ const startWorker = (workerId) => {
       return 'direct';
     case '/api/v1/streaming/list':
       return 'list';
+    default:
+      return undefined;
     }
   };
 
@@ -476,7 +478,7 @@ const startWorker = (workerId) => {
         log.verbose(req.requestId, `Closing connection for ${req.accountId} due to expired access token`);
         eventHandlers.onKill();
       }
-    }
+    };
   };
 
   /**
@@ -531,7 +533,8 @@ const startWorker = (workerId) => {
     log.error(req.requestId, err.toString());
 
     if (res.headersSent) {
-      return next(err);
+      next(err);
+      return;
     }
 
     res.writeHead(err.status || 500, { 'Content-Type': 'application/json' });
@@ -1054,7 +1057,7 @@ const startWorker = (workerId) => {
       if (type === 'subscribe') {
         subscribeWebsocketToChannel(session, firstParam(stream), params);
       } else if (type === 'unsubscribe') {
-        unsubscribeWebsocketFromChannel(session, firstParam(stream), params)
+        unsubscribeWebsocketFromChannel(session, firstParam(stream), params);
       } else {
         // Unknown action type
       }