fix(simulator): remove unneeded main thread check at simulator start
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 7 Nov 2023 20:11:57 +0000 (21:11 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 7 Nov 2023 20:11:57 +0000 (21:11 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Bootstrap.ts

index f3f6d8b08531e52678772cfad3889f09dd0d9ce7..4e848c1f29adcb9f88eb6f5a90ea0a6e93ea972a 100644 (file)
@@ -4,7 +4,6 @@ import { EventEmitter } from 'node:events';
 import { dirname, extname, join } from 'node:path';
 import { exit } from 'node:process';
 import { fileURLToPath } from 'node:url';
-import { isMainThread } from 'node:worker_threads';
 
 import chalk from 'chalk';
 import { availableParallelism } from 'poolifier';
@@ -111,9 +110,6 @@ export class Bootstrap extends EventEmitter {
   }
 
   public async start(): Promise<void> {
-    if (!isMainThread) {
-      throw new BaseError('Cannot start charging stations simulator from worker thread');
-    }
     if (this.started === false) {
       if (this.starting === false) {
         this.starting = true;