elementsPerWorker,
poolOptions: {
messageHandler: this.messageHandler.bind(this) as MessageHandler<Worker>,
- workerOptions: { resourceLimits: workerConfiguration.resourceLimits }
+ ...(workerConfiguration.resourceLimits != null && {
+ workerOptions: { resourceLimits: workerConfiguration.resourceLimits }
+ })
}
}
)
stationInfoFromFile.templateHash === stationInfoFromTemplate.templateHash
) {
return setChargingStationOptions(
- { ...Constants.DEFAULT_STATION_INFO, ...stationInfoFromFile },
+ mergeDeepRight(Constants.DEFAULT_STATION_INFO, stationInfoFromFile),
options
)
}
stationInfoFromTemplate
)
return setChargingStationOptions(
- { ...Constants.DEFAULT_STATION_INFO, ...stationInfoFromTemplate },
+ mergeDeepRight(Constants.DEFAULT_STATION_INFO, stationInfoFromTemplate),
options
)
}
import { isMainThread } from 'node:worker_threads'
+import { mergeDeepRight } from 'rambda'
+
import type { WorkerAbstract } from './WorkerAbstract.js'
import { DEFAULT_WORKER_OPTIONS } from './WorkerConstants.js'
import { WorkerDynamicPool } from './WorkerDynamicPool.js'
if (!isMainThread) {
throw new Error('Cannot get a worker implementation outside the main thread')
}
- workerOptions = { ...DEFAULT_WORKER_OPTIONS, ...workerOptions }
+ workerOptions = mergeDeepRight<WorkerOptions>(DEFAULT_WORKER_OPTIONS, workerOptions ?? {})
let workerImplementation: WorkerAbstract<T>
switch (workerProcessType) {
case WorkerProcessType.workerSet: