@vendure/job-queue-plugin
Advanced tools
Comparing version 1.4.7 to 2.0.0-next.0
{ | ||
"name": "@vendure/job-queue-plugin", | ||
"version": "1.4.7", | ||
"version": "2.0.0-next.0", | ||
"license": "MIT", | ||
@@ -26,11 +26,10 @@ "main": "package/index.js", | ||
"@google-cloud/pubsub": "^2.8.0", | ||
"@types/redis": "^2.8.28", | ||
"@vendure/common": "^1.4.7", | ||
"@vendure/core": "^1.4.7", | ||
"bullmq": "^1.40.1", | ||
"redis": "^3.0.2", | ||
"@types/ioredis": "^4.28.8", | ||
"@vendure/common": "^2.0.0-next.0", | ||
"@vendure/core": "^2.0.0-next.0", | ||
"bullmq": "^1.74.3", | ||
"rimraf": "^3.0.2", | ||
"typescript": "4.3.5" | ||
"typescript": "4.5.5" | ||
}, | ||
"gitHead": "a8e68227456fb5483f4ef4bfb9128f408d583221" | ||
"gitHead": "1db9e96a8c92b23b4d06c6b83e4ab2b428afab7c" | ||
} |
@@ -24,2 +24,3 @@ "use strict"; | ||
async init(injector) { | ||
var _a, _b; | ||
const options = injector.get(constants_1.BULLMQ_PLUGIN_OPTIONS); | ||
@@ -36,3 +37,3 @@ this.options = options; | ||
} | ||
this.queue = new bullmq_1.Queue(QUEUE_NAME, Object.assign(Object.assign({}, options.queueOptions), { connection: options.connection })).on('error', (e) => core_1.Logger.error(`BullMQ Queue error: ${e.message}`, constants_1.loggerCtx, e.stack)); | ||
this.queue = new bullmq_1.Queue(QUEUE_NAME, Object.assign(Object.assign({}, options.queueOptions), { connection: (_a = options.connection) !== null && _a !== void 0 ? _a : {} })).on('error', (e) => core_1.Logger.error(`BullMQ Queue error: ${e.message}`, constants_1.loggerCtx, e.stack)); | ||
if (await this.queue.isPaused()) { | ||
@@ -60,3 +61,3 @@ await this.queue.resume(); | ||
}; | ||
this.scheduler = new bullmq_1.QueueScheduler(QUEUE_NAME, Object.assign(Object.assign({}, options.schedulerOptions), { connection: options.connection })).on('error', (e) => core_1.Logger.error(`BullMQ Scheduler error: ${e.message}`, constants_1.loggerCtx, e.stack)); | ||
this.scheduler = new bullmq_1.QueueScheduler(QUEUE_NAME, Object.assign(Object.assign({}, options.schedulerOptions), { connection: (_b = options.connection) !== null && _b !== void 0 ? _b : {} })).on('failed', (e) => core_1.Logger.error(`BullMQ Scheduler error: ${e.message}`, constants_1.loggerCtx, e.stack)); | ||
} | ||
@@ -178,8 +179,9 @@ async destroy() { | ||
async start(queueName, process) { | ||
var _a; | ||
this.queueNameProcessFnMap.set(queueName, process); | ||
if (!this.worker) { | ||
const options = Object.assign(Object.assign({ concurrency: DEFAULT_CONCURRENCY }, this.options.workerOptions), { connection: this.options.connection }); | ||
const options = Object.assign(Object.assign({ concurrency: DEFAULT_CONCURRENCY }, this.options.workerOptions), { connection: (_a = this.options.connection) !== null && _a !== void 0 ? _a : {} }); | ||
this.worker = new bullmq_1.Worker(QUEUE_NAME, this.workerProcessor, options) | ||
.on('error', (e) => core_1.Logger.error(`BullMQ Worker error: ${e.message}`, constants_1.loggerCtx, e.stack)) | ||
.on('failed', (job, failedReason) => { | ||
.on('failed', (job, error) => { | ||
var _a; | ||
@@ -186,0 +188,0 @@ core_1.Logger.warn(`Job ${job.id} [${job.name}] failed (attempt ${job.attemptsMade} of ${(_a = job.opts.attempts) !== null && _a !== void 0 ? _a : 1})`); |
@@ -0,3 +1,4 @@ | ||
import { JobType } from 'bullmq'; | ||
export declare const loggerCtx = "BullMQJobQueuePlugin"; | ||
export declare const BULLMQ_PLUGIN_OPTIONS: unique symbol; | ||
export declare const ALL_JOB_TYPES: string[]; | ||
export declare const ALL_JOB_TYPES: JobType[]; |
@@ -125,3 +125,3 @@ "use strict"; | ||
BullMQJobQueuePlugin = BullMQJobQueuePlugin_1 = __decorate([ | ||
core_1.VendurePlugin({ | ||
(0, core_1.VendurePlugin)({ | ||
imports: [core_1.PluginCommonModule], | ||
@@ -128,0 +128,0 @@ configuration: config => { |
@@ -72,4 +72,4 @@ "use strict"; | ||
RedisHealthIndicator = __decorate([ | ||
common_1.Injectable(), | ||
__param(0, common_1.Inject(constants_1.BULLMQ_PLUGIN_OPTIONS)), | ||
(0, common_1.Injectable)(), | ||
__param(0, (0, common_1.Inject)(constants_1.BULLMQ_PLUGIN_OPTIONS)), | ||
__metadata("design:paramtypes", [Object]) | ||
@@ -76,0 +76,0 @@ ], RedisHealthIndicator); |
@@ -22,3 +22,3 @@ "use strict"; | ||
PubSubPlugin = PubSubPlugin_1 = __decorate([ | ||
core_1.VendurePlugin({ | ||
(0, core_1.VendurePlugin)({ | ||
imports: [core_1.PluginCommonModule], | ||
@@ -25,0 +25,0 @@ providers: [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68006
7
1076
1
40