Procházet zdrojové kódy

fix(job-queue-plugin): Fix graceful shutdown for BullMQJobQueueStrategy

Fixes #2222
Michael Bromley před 2 roky
rodič
revize
7c51eab1c8

+ 1 - 1
packages/job-queue-plugin/package.json

@@ -25,7 +25,7 @@
         "@google-cloud/pubsub": "^2.8.0",
         "@vendure/common": "^2.0.0",
         "@vendure/core": "^2.0.0",
-        "bullmq": "^3.6.1",
+        "bullmq": "^3.15.5",
         "ioredis": "^5.3.0",
         "rimraf": "^3.0.2",
         "typescript": "4.9.5"

+ 1 - 1
packages/job-queue-plugin/src/bullmq/bullmq-job-queue-strategy.ts

@@ -259,7 +259,7 @@ export class BullMQJobQueueStrategy implements InspectableJobQueueStrategy {
         if (!this.stopped) {
             this.stopped = true;
             try {
-                await Promise.all([this.queue.disconnect(), this.worker.disconnect()]);
+                await Promise.all([this.queue.close(), this.worker.close()]);
             } catch (e: any) {
                 Logger.error(e, loggerCtx, e.stack);
             }

+ 4 - 4
yarn.lock

@@ -7105,10 +7105,10 @@ builtins@^5.0.0:
   dependencies:
     semver "^7.0.0"
 
-bullmq@^3.6.1:
-  version "3.12.0"
-  resolved "https://registry.yarnpkg.com/bullmq/-/bullmq-3.12.0.tgz#5a3e9ac40e4d623c27f7cdd214a69fd4122270da"
-  integrity sha512-h5SMgKXfHe6wKzEEdKTO4zUkOV1TkyQagw3WVOaz+6XWuaWv4EhCAOIkzPAajI7ZNF9c+YwSRY3bQjXmxI0f9Q==
+bullmq@^3.15.5:
+  version "3.15.5"
+  resolved "https://registry.yarnpkg.com/bullmq/-/bullmq-3.15.5.tgz#b8e80f47cd167a0ce77e34e47404adcb98447813"
+  integrity sha512-NotMUfU5wBAjZQgcl/F5UMUIs1DiXDRmZBN5BPuSQ841w7mYlaghTMGSy0H+kAwFa7388e7/5COTiX8EUxFo5w==
   dependencies:
     cron-parser "^4.6.0"
     glob "^8.0.3"