X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FUtils.ts;h=02164b1d3be956ec4edb9e1a537d624ba7b725bf;hb=594dc437c5f4a82cc8ebeabd1649a479d42c0110;hp=878d49d63e473572527f35bcaf8d208e4fa04476;hpb=a9dc13ad1ecd86e315a45dbfb427be0ed145bf3c;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 878d49d6..02164b1d 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -1,4 +1,6 @@ +import Configuration from './Configuration'; import { WebSocketCloseEventStatusString } from '../types/WebSocket'; +import { WorkerProcessType } from '../types/Worker'; import { v4 as uuid } from 'uuid'; export default class Utils { @@ -205,8 +207,16 @@ export default class Utils { } } if (!Utils.isUndefined(WebSocketCloseEventStatusString[code])) { - return WebSocketCloseEventStatusString[code]; + return WebSocketCloseEventStatusString[code] as string; } return '(Unknown)'; } + + static workerPoolInUse(): boolean { + return Configuration.getWorkerProcess() === WorkerProcessType.DYNAMIC_POOL || Configuration.getWorkerProcess() === WorkerProcessType.STATIC_POOL; + } + + static workerDynamicPoolInUse(): boolean { + return Configuration.getWorkerProcess() === WorkerProcessType.DYNAMIC_POOL; + } }