From: Jérôme Benoit Date: Sun, 29 Aug 2021 12:56:46 +0000 (+0200) Subject: Add support for performance storage on worker pool X-Git-Tag: v1.0.51~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b55c9112fb601a6b8d744ecbf7126ac6c97b8188;p=e-mobility-charging-stations-simulator.git Add support for performance storage on worker pool Update poolifier to the latest version supporting the definition of a message handler on the workers. Signed-off-by: Jérôme Benoit --- diff --git a/package-lock.json b/package-lock.json index 54efe9e7..d370896d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11791,9 +11791,9 @@ } }, "poolifier": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-2.0.2.tgz", - "integrity": "sha512-qibRFXZlhYJYf/jIoayoOb31S8EeMDF89H9ujOQh1xOxLreYZ0EzCEnnOR8OdpdAxyl+JKyt7sgFLHK78WTV5w==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-2.1.0.tgz", + "integrity": "sha512-tUYviyPvVLnnxdL0ROKwTohZfbf4HGldRwO2Qw4X0wrO/X3eZIbs5OELW7tMqPN3BdmbYI7JdIWfw4woQRf+rQ==" }, "postcss": { "version": "8.2.15", diff --git a/package.json b/package.json index 018fb963..88d41d82 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "chalk": "^4.1.2", "mongodb": "^4.1.1", "mysql2": "^2.3.0", - "poolifier": "^2.0.2", + "poolifier": "^2.1.0", "reflect-metadata": "^0.1.13", "source-map-support": "^0.5.19", "sqlite3": "^5.0.2", diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index 65d2f4d4..d97e9604 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -21,7 +21,7 @@ export default class WorkerFactory { options = options ?? {} as WorkerOptions; options.startDelay = options.startDelay ?? Constants.WORKER_START_DELAY; options.poolOptions = options?.poolOptions ?? {} as PoolOptions; - // options?.messageHandler && options.poolOptions.messageHandler = options.messageHandler; + options?.messageHandler && (options.poolOptions.messageHandler = options.messageHandler); let workerImplementation: WorkerAbstract = null; switch (workerProcessType) { case WorkerProcessType.WORKER_SET: