repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Type properly station worker data.
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
Utils.ts
diff --git
a/src/utils/Utils.ts
b/src/utils/Utils.ts
index 9969e2294210777d281f43a3278a1dc150b16aa6..8ea05765f5c3e530329814d81bcdfd0310b800d4 100644
(file)
--- a/
src/utils/Utils.ts
+++ b/
src/utils/Utils.ts
@@
-1,4
+1,6
@@
+import Configuration from './Configuration';
import { WebSocketCloseEventStatusString } from '../types/WebSocket';
import { WebSocketCloseEventStatusString } from '../types/WebSocket';
+import { WorkerProcessType } from '../types/Worker';
import { v4 as uuid } from 'uuid';
export default class Utils {
import { v4 as uuid } from 'uuid';
export default class Utils {
@@
-11,7
+13,7
@@
export default class Utils {
}
static secondsToHHMMSS(seconds: number): string {
}
static secondsToHHMMSS(seconds: number): string {
- return
new Date(seconds * 1000).toISOString().substr(11, 8
);
+ return
Utils.milliSecondsToHHMMSS(seconds * 1000
);
}
static milliSecondsToHHMMSS(milliSeconds: number): string {
}
static milliSecondsToHHMMSS(milliSeconds: number): string {
@@
-205,8
+207,12
@@
export default class Utils {
}
}
if (!Utils.isUndefined(WebSocketCloseEventStatusString[code])) {
}
}
if (!Utils.isUndefined(WebSocketCloseEventStatusString[code])) {
- return WebSocketCloseEventStatusString[code];
+ return WebSocketCloseEventStatusString[code]
as string
;
}
return '(Unknown)';
}
}
return '(Unknown)';
}
+
+ static workerPoolInUse(): boolean {
+ return Configuration.getWorkerProcess() === WorkerProcessType.DYNAMIC_POOL || Configuration.getWorkerProcess() === WorkerProcessType.STATIC_POOL;
+ }
}
}