src/charging-station/StationWorker.ts: renaming and typing
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 18 Mar 2021 20:33:27 +0000 (21:33 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 18 Mar 2021 20:33:27 +0000 (21:33 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.eslintrc
src/charging-station/StationWorker.ts

index f44ad63d64f4b97fb1c47dd26ac273bd3a60c1ed..68996a2e275b396c17c543415c6d801885e9ffcd 100644 (file)
--- a/.eslintrc
+++ b/.eslintrc
       }
     ],
     "block-spacing": "error",
-    "capitalized-comments": [
-      "error",
-      "always",
-      {
-        "ignoreConsecutiveComments": true,
-        "ignorePattern": "pragma|ignored"
-      }
-    ],
+    // "capitalized-comments": [
+    //   "error",
+    //   "always",
+    //   {
+    //     "ignoreConsecutiveComments": true,
+    //     "ignorePattern": "pragma|ignored"
+    //   }
+    // ],
     "eol-last": [
       "error",
       "always"
index edc306f9916cbeded55af1123b67da7816ee26d6..45449c1b5bfc76bbad8757af5aaa9bcf52a5b7aa 100644 (file)
@@ -7,18 +7,18 @@ import { ThreadWorker } from 'poolifier';
 import Utils from '../utils/Utils';
 
 // Conditionally export ThreadWorker instance for pool usage
-export let threadWorker;
+export let threadWorker: ThreadWorker;
 if (Utils.workerPoolInUse()) {
   threadWorker = new ThreadWorker<StationWorkerData>(startChargingStation, { maxInactiveTime: Constants.WORKER_POOL_MAX_INACTIVE_TIME, async: false });
 } else {
-  // Add listener to start charging station from main thread
-  addListener();
+  // Add message listener to start charging station from main thread
+  addMessageListener();
   if (!Utils.isUndefined(workerData)) {
     startChargingStation({ index: workerData.index as number, templateFile: workerData.templateFile as string });
   }
 }
 
-function addListener(): void {
+function addMessageListener(): void {
   parentPort.on('message', (message) => {
     if (message.id === WorkerEvents.START_WORKER_ELEMENT) {
       startChargingStation(message.workerData);