@tachybase/plugin-adapter-bullmq 0.23.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -0
- package/README.md +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +1 -0
- package/dist/externalVersion.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/node_modules/@bull-board/api/bullAdapter.d.ts +1 -0
- package/dist/node_modules/@bull-board/api/bullAdapter.js +1 -0
- package/dist/node_modules/@bull-board/api/bullMQAdapter.d.ts +1 -0
- package/dist/node_modules/@bull-board/api/bullMQAdapter.js +1 -0
- package/dist/node_modules/@bull-board/api/dist/src/constants/statuses.d.ts +11 -0
- package/dist/node_modules/@bull-board/api/dist/src/constants/statuses.js +15 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/addJob.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/addJob.js +18 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/cleanAll.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/cleanAll.js +15 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/cleanJob.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/cleanJob.js +14 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/emptyQueue.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/emptyQueue.js +10 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/entryPoint.d.ts +5 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/entryPoint.js +21 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/error.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/error.js +14 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/job.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/job.js +20 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/jobLogs.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/jobLogs.js +16 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseQueue.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseQueue.js +10 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/promotJob.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/promotJob.js +14 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/promoteAll.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/promoteAll.js +10 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/queues.d.ts +4 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/queues.js +76 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/redisStats.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/redisStats.js +33 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeQueue.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeQueue.js +10 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/retryAll.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/retryAll.js +12 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/retryJob.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/retryJob.js +15 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/updateJobData.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/updateJobData.js +20 -0
- package/dist/node_modules/@bull-board/api/dist/src/index.d.ts +12 -0
- package/dist/node_modules/@bull-board/api/dist/src/index.js +1 -0
- package/dist/node_modules/@bull-board/api/dist/src/providers/job.d.ts +3 -0
- package/dist/node_modules/@bull-board/api/dist/src/providers/job.js +19 -0
- package/dist/node_modules/@bull-board/api/dist/src/providers/queue.d.ts +5 -0
- package/dist/node_modules/@bull-board/api/dist/src/providers/queue.js +20 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.d.ts +31 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.js +27 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/bull.d.ts +23 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/bull.js +87 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/bullMQ.d.ts +22 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/bullMQ.js +91 -0
- package/dist/node_modules/@bull-board/api/dist/src/queuesApi.d.ts +9 -0
- package/dist/node_modules/@bull-board/api/dist/src/queuesApi.js +32 -0
- package/dist/node_modules/@bull-board/api/dist/src/routes.d.ts +2 -0
- package/dist/node_modules/@bull-board/api/dist/src/routes.js +96 -0
- package/dist/node_modules/@bull-board/api/dist/typings/app.d.ts +203 -0
- package/dist/node_modules/@bull-board/api/dist/typings/app.js +3 -0
- package/dist/node_modules/@bull-board/api/dist/typings/responses.d.ts +8 -0
- package/dist/node_modules/@bull-board/api/dist/typings/responses.js +3 -0
- package/dist/node_modules/@bull-board/api/dist/typings/utils.d.ts +1 -0
- package/dist/node_modules/@bull-board/api/dist/typings/utils.js +3 -0
- package/dist/node_modules/@bull-board/api/package.json +1 -0
- package/dist/node_modules/@bull-board/koa/dist/KoaAdapter.d.ts +23 -0
- package/dist/node_modules/@bull-board/koa/dist/KoaAdapter.js +125 -0
- package/dist/node_modules/@bull-board/koa/dist/index.d.ts +1 -0
- package/dist/node_modules/@bull-board/koa/dist/index.js +415 -0
- package/dist/node_modules/@bull-board/koa/node_modules/.bin/ejs +17 -0
- package/dist/node_modules/@bull-board/koa/package.json +1 -0
- package/dist/node_modules/bullmq/LICENSE +21 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/async-fifo-queue.js +129 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/backoffs.js +48 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/child-pool.js +71 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/child-processor.js +154 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/child.js +210 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/errors/delayed-error.js +20 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/errors/index.js +8 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/errors/rate-limit-error.js +19 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/errors/unrecoverable-error.js +20 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/errors/waiting-children-error.js +20 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/flow-producer.js +339 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/index.js +25 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/job-scheduler.js +221 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/job.js +893 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/main-base.js +44 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/main-worker.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/main-worker.js +10 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/main.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/main.js +10 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/queue-base.js +155 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/queue-events-producer.js +42 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/queue-events.js +125 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/queue-getters.js +450 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/queue-keys.js +43 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/queue.js +635 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/redis-connection.js +270 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/repeat.js +204 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/sandbox.js +75 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/scripts.js +1035 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/worker.js +819 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/addDelayedJob-6.lua +119 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/addJobScheduler-2.lua +91 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/addLog-2.lua +30 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/addParentJob-4.lua +104 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/addPrioritizedJob-8.lua +117 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/addRepeatableJob-2.lua +84 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/addStandardJob-8.lua +122 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/changeDelay-4.lua +55 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/changePriority-7.lua +68 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/cleanJobsInSet-3.lua +55 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/drain-5.lua +41 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/extendLock-2.lua +23 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/extendLocks-1.lua +44 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getCounts-1.lua +36 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getCountsPerPriority-4.lua +35 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getJobScheduler-1.lua +19 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getRanges-1.lua +70 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getRateLimitTtl-1.lua +20 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getState-8.lua +65 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getStateV2-8.lua +58 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/addBaseMarkerIfNeeded.lua +9 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/addDelayMarkerIfNeeded.lua +15 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobInTargetList.lua +11 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobWithPriority.lua +14 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/batches.lua +18 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/checkItemInList.lua +12 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanList.lua +47 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanSet.lua +66 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/collectMetrics.lua +46 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/deduplicateJob.lua +24 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/destructureJobKey.lua +12 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/findPage.lua +70 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getDelayedScore.lua +25 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getJobsInZset.lua +13 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getNextDelayedTimestamp.lua +12 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getOrSetMaxEvents.lua +11 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getRateLimitTTL.lua +17 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getTargetQueueList.lua +22 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getTimestamp.lua +19 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getZSetItems.lua +7 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/handleDuplicatedJob.lua +26 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/isLocked.lua +33 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/isQueueMaxed.lua +15 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/isQueuePaused.lua +7 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/isQueuePausedOrMaxed.lua +18 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveJobFromPriorityToActive.lua +13 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentFromWaitingChildrenToFailed.lua +53 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWaitIfNeeded.lua +55 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/prepareJobForProcessing.lua +50 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/promoteDelayedJobs.lua +40 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/pushBackJobWithPriority.lua +9 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKey.lua +11 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeeded.lua +14 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJob.lua +17 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobFromAnyState.lua +35 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobKeys.lua +8 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobs.lua +13 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobsByMaxAge.lua +16 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobsByMaxCount.lua +15 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobsOnFail.lua +36 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeListJobs.lua +17 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeLock.lua +19 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeParentDependencyKey.lua +90 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeZSetJobs.lua +27 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/storeJob.lua +36 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/trimEvents.lua +15 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateExistingJobsParent.lua +27 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateJobFields.lua +11 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateParentDepsIfNeeded.lua +13 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/isFinished-3.lua +48 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/isJobInList-1.lua +16 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/isMaxed-2.lua +17 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveJobFromActiveToWait-10.lua +60 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveJobsToWait-8.lua +73 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveStalledJobsToWait-9.lua +156 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToActive-11.lua +93 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToDelayed-8.lua +77 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToFinished-14.lua +283 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToWaitingChildren-5.lua +68 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/obliterate-2.lua +118 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/paginate-1.lua +49 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/pause-7.lua +42 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/promote-9.lua +62 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/releaseLock-1.lua +19 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/removeChildDependency-1.lua +34 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/removeJob-2.lua +92 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/removeJobScheduler-3.lua +43 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/removeRepeatable-3.lua +58 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/reprocessJob-8.lua +49 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/retryJob-11.lua +82 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/saveStacktrace-1.lua +19 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/updateData-1.lua +20 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/updateProgress-3.lua +33 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/updateRepeatableJobMillis-1.lua +28 -0
- package/dist/node_modules/bullmq/dist/cjs/enums/child-command.js +10 -0
- package/dist/node_modules/bullmq/dist/cjs/enums/error-code.js +15 -0
- package/dist/node_modules/bullmq/dist/cjs/enums/index.js +9 -0
- package/dist/node_modules/bullmq/dist/cjs/enums/metrics-time.js +15 -0
- package/dist/node_modules/bullmq/dist/cjs/enums/parent-command.js +16 -0
- package/dist/node_modules/bullmq/dist/cjs/enums/telemetry-attributes.js +48 -0
- package/dist/node_modules/bullmq/dist/cjs/index.js +1 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/advanced-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/backoff-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/base-job-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/child-message.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/connection.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/debounce-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/flow-job.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/index.js +32 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/ioredis-events.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/job-json.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/job-scheduler-json.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/keep-jobs.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/metrics-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/metrics.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/minimal-job.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/parent-message.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/parent.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/queue-options.js +9 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/rate-limiter-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/redis-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/redis-streams.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/repeat-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/repeatable-job.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/repeatable-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/sandboxed-job-processor.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/sandboxed-job.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/sandboxed-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/telemetry.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/interfaces/worker-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addDelayedJob-6.js +373 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addJobScheduler-2.js +237 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addLog-2.js +33 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addParentJob-4.js +340 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addPrioritizedJob-8.js +350 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addRepeatableJob-2.js +230 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addStandardJob-8.js +354 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/changeDelay-4.js +107 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/changePriority-7.js +122 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/cleanJobsInSet-3.js +350 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/drain-5.js +258 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/extendLock-2.js +30 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/extendLocks-1.js +46 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getCounts-1.js +42 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getCountsPerPriority-4.js +46 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getJobScheduler-1.js +23 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getRanges-1.js +73 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getRateLimitTtl-1.js +39 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getState-8.js +73 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getStateV2-8.js +57 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/index.js +49 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/isFinished-3.js +49 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/isJobInList-1.js +32 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/isMaxed-2.js +34 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveJobFromActiveToWait-10.js +110 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveJobsToWait-8.js +118 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveStalledJobsToWait-9.js +529 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToActive-11.js +233 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToDelayed-8.js +156 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToFinished-14.js +798 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToWaitingChildren-5.js +83 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/obliterate-2.js +327 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/paginate-1.js +110 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/pause-7.js +67 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/promote-9.js +105 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/releaseLock-1.js +25 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeChildDependency-1.js +165 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeJob-2.js +292 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeJobScheduler-3.js +49 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeRepeatable-3.js +63 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/reprocessJob-8.js +96 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/retryJob-11.js +193 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/saveStacktrace-1.js +27 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/updateData-1.js +26 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/updateProgress-3.js +46 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/updateRepeatableJobMillis-1.js +33 -0
- package/dist/node_modules/bullmq/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/node_modules/bullmq/dist/cjs/types/backoff-strategy.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/finished-status.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/index.js +12 -0
- package/dist/node_modules/bullmq/dist/cjs/types/job-json-sandbox.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/job-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/job-scheduler-template-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/job-type.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/minimal-queue.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/repeat-strategy.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/utils.js +288 -0
- package/dist/node_modules/bullmq/dist/cjs/version.js +5 -0
- package/dist/node_modules/bullmq/dist/esm/classes/async-fifo-queue.d.ts +37 -0
- package/dist/node_modules/bullmq/dist/esm/classes/async-fifo-queue.js +125 -0
- package/dist/node_modules/bullmq/dist/esm/classes/backoffs.d.ts +10 -0
- package/dist/node_modules/bullmq/dist/esm/classes/backoffs.js +44 -0
- package/dist/node_modules/bullmq/dist/esm/classes/child-pool.d.ts +23 -0
- package/dist/node_modules/bullmq/dist/esm/classes/child-pool.js +67 -0
- package/dist/node_modules/bullmq/dist/esm/classes/child-processor.d.ts +37 -0
- package/dist/node_modules/bullmq/dist/esm/classes/child-processor.js +150 -0
- package/dist/node_modules/bullmq/dist/esm/classes/child.d.ts +35 -0
- package/dist/node_modules/bullmq/dist/esm/classes/child.js +206 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/delayed-error.d.ts +11 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/delayed-error.js +16 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/index.d.ts +4 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/index.js +5 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/rate-limit-error.d.ts +10 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/rate-limit-error.js +15 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/unrecoverable-error.d.ts +11 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/unrecoverable-error.js +16 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-children-error.d.ts +11 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-children-error.js +16 -0
- package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.d.ts +179 -0
- package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.js +335 -0
- package/dist/node_modules/bullmq/dist/esm/classes/index.d.ts +19 -0
- package/dist/node_modules/bullmq/dist/esm/classes/index.js +22 -0
- package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.d.ts +24 -0
- package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.js +216 -0
- package/dist/node_modules/bullmq/dist/esm/classes/job.d.ts +425 -0
- package/dist/node_modules/bullmq/dist/esm/classes/job.js +889 -0
- package/dist/node_modules/bullmq/dist/esm/classes/main-base.d.ts +4 -0
- package/dist/node_modules/bullmq/dist/esm/classes/main-base.js +42 -0
- package/dist/node_modules/bullmq/dist/esm/classes/main-worker.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/esm/classes/main-worker.js +8 -0
- package/dist/node_modules/bullmq/dist/esm/classes/main.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/esm/classes/main.js +8 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-base.d.ts +83 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-base.js +151 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-events-producer.d.ts +21 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-events-producer.js +38 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-events.d.ts +201 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-events.js +121 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.d.ts +235 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.js +447 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-keys.d.ts +10 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue-keys.js +39 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue.d.ts +406 -0
- package/dist/node_modules/bullmq/dist/esm/classes/queue.js +631 -0
- package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.d.ts +46 -0
- package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.js +266 -0
- package/dist/node_modules/bullmq/dist/esm/classes/repeat.d.ts +25 -0
- package/dist/node_modules/bullmq/dist/esm/classes/repeat.js +199 -0
- package/dist/node_modules/bullmq/dist/esm/classes/sandbox.d.ts +4 -0
- package/dist/node_modules/bullmq/dist/esm/classes/sandbox.js +73 -0
- package/dist/node_modules/bullmq/dist/esm/classes/scripts.d.ts +160 -0
- package/dist/node_modules/bullmq/dist/esm/classes/scripts.js +1031 -0
- package/dist/node_modules/bullmq/dist/esm/classes/worker.d.ts +231 -0
- package/dist/node_modules/bullmq/dist/esm/classes/worker.js +815 -0
- package/dist/node_modules/bullmq/dist/esm/commands/addDelayedJob-6.lua +119 -0
- package/dist/node_modules/bullmq/dist/esm/commands/addJobScheduler-2.lua +91 -0
- package/dist/node_modules/bullmq/dist/esm/commands/addLog-2.lua +30 -0
- package/dist/node_modules/bullmq/dist/esm/commands/addParentJob-4.lua +104 -0
- package/dist/node_modules/bullmq/dist/esm/commands/addPrioritizedJob-8.lua +117 -0
- package/dist/node_modules/bullmq/dist/esm/commands/addRepeatableJob-2.lua +84 -0
- package/dist/node_modules/bullmq/dist/esm/commands/addStandardJob-8.lua +122 -0
- package/dist/node_modules/bullmq/dist/esm/commands/changeDelay-4.lua +55 -0
- package/dist/node_modules/bullmq/dist/esm/commands/changePriority-7.lua +68 -0
- package/dist/node_modules/bullmq/dist/esm/commands/cleanJobsInSet-3.lua +55 -0
- package/dist/node_modules/bullmq/dist/esm/commands/drain-5.lua +41 -0
- package/dist/node_modules/bullmq/dist/esm/commands/extendLock-2.lua +23 -0
- package/dist/node_modules/bullmq/dist/esm/commands/extendLocks-1.lua +44 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getCounts-1.lua +36 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getCountsPerPriority-4.lua +35 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getJobScheduler-1.lua +19 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getRanges-1.lua +70 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getRateLimitTtl-1.lua +20 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getState-8.lua +65 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getStateV2-8.lua +58 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/addBaseMarkerIfNeeded.lua +9 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/addDelayMarkerIfNeeded.lua +15 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobInTargetList.lua +11 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobWithPriority.lua +14 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/batches.lua +18 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/checkItemInList.lua +12 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanList.lua +47 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanSet.lua +66 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/collectMetrics.lua +46 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/deduplicateJob.lua +24 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/destructureJobKey.lua +12 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/findPage.lua +70 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getDelayedScore.lua +25 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getJobsInZset.lua +13 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getNextDelayedTimestamp.lua +12 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getOrSetMaxEvents.lua +11 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getRateLimitTTL.lua +17 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getTargetQueueList.lua +22 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getTimestamp.lua +19 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getZSetItems.lua +7 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/handleDuplicatedJob.lua +26 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/isLocked.lua +33 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/isQueueMaxed.lua +15 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/isQueuePaused.lua +7 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/isQueuePausedOrMaxed.lua +18 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveJobFromPriorityToActive.lua +13 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentFromWaitingChildrenToFailed.lua +53 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWaitIfNeeded.lua +55 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/prepareJobForProcessing.lua +50 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/promoteDelayedJobs.lua +40 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/pushBackJobWithPriority.lua +9 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKey.lua +11 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeeded.lua +14 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJob.lua +17 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobFromAnyState.lua +35 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobKeys.lua +8 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobs.lua +13 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobsByMaxAge.lua +16 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobsByMaxCount.lua +15 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobsOnFail.lua +36 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeListJobs.lua +17 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeLock.lua +19 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeParentDependencyKey.lua +90 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeZSetJobs.lua +27 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/storeJob.lua +36 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/trimEvents.lua +15 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/updateExistingJobsParent.lua +27 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/updateJobFields.lua +11 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/updateParentDepsIfNeeded.lua +13 -0
- package/dist/node_modules/bullmq/dist/esm/commands/isFinished-3.lua +48 -0
- package/dist/node_modules/bullmq/dist/esm/commands/isJobInList-1.lua +16 -0
- package/dist/node_modules/bullmq/dist/esm/commands/isMaxed-2.lua +17 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveJobFromActiveToWait-10.lua +60 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveJobsToWait-8.lua +73 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveStalledJobsToWait-9.lua +156 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveToActive-11.lua +93 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveToDelayed-8.lua +77 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveToFinished-14.lua +283 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveToWaitingChildren-5.lua +68 -0
- package/dist/node_modules/bullmq/dist/esm/commands/obliterate-2.lua +118 -0
- package/dist/node_modules/bullmq/dist/esm/commands/paginate-1.lua +49 -0
- package/dist/node_modules/bullmq/dist/esm/commands/pause-7.lua +42 -0
- package/dist/node_modules/bullmq/dist/esm/commands/promote-9.lua +62 -0
- package/dist/node_modules/bullmq/dist/esm/commands/releaseLock-1.lua +19 -0
- package/dist/node_modules/bullmq/dist/esm/commands/removeChildDependency-1.lua +34 -0
- package/dist/node_modules/bullmq/dist/esm/commands/removeJob-2.lua +92 -0
- package/dist/node_modules/bullmq/dist/esm/commands/removeJobScheduler-3.lua +43 -0
- package/dist/node_modules/bullmq/dist/esm/commands/removeRepeatable-3.lua +58 -0
- package/dist/node_modules/bullmq/dist/esm/commands/reprocessJob-8.lua +49 -0
- package/dist/node_modules/bullmq/dist/esm/commands/retryJob-11.lua +82 -0
- package/dist/node_modules/bullmq/dist/esm/commands/saveStacktrace-1.lua +19 -0
- package/dist/node_modules/bullmq/dist/esm/commands/updateData-1.lua +20 -0
- package/dist/node_modules/bullmq/dist/esm/commands/updateProgress-3.lua +33 -0
- package/dist/node_modules/bullmq/dist/esm/commands/updateRepeatableJobMillis-1.lua +28 -0
- package/dist/node_modules/bullmq/dist/esm/enums/child-command.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/enums/child-command.js +7 -0
- package/dist/node_modules/bullmq/dist/esm/enums/error-code.d.ts +10 -0
- package/dist/node_modules/bullmq/dist/esm/enums/error-code.js +12 -0
- package/dist/node_modules/bullmq/dist/esm/enums/index.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/enums/index.js +6 -0
- package/dist/node_modules/bullmq/dist/esm/enums/metrics-time.d.ts +10 -0
- package/dist/node_modules/bullmq/dist/esm/enums/metrics-time.js +12 -0
- package/dist/node_modules/bullmq/dist/esm/enums/parent-command.d.ts +11 -0
- package/dist/node_modules/bullmq/dist/esm/enums/parent-command.js +13 -0
- package/dist/node_modules/bullmq/dist/esm/enums/telemetry-attributes.d.ts +42 -0
- package/dist/node_modules/bullmq/dist/esm/enums/telemetry-attributes.js +45 -0
- package/dist/node_modules/bullmq/dist/esm/index.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/index.js +6 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/advanced-options.d.ts +18 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/advanced-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/backoff-options.d.ts +15 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/backoff-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts +100 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/base-job-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/child-message.d.ts +6 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/child-message.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/connection.d.ts +8 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/connection.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.d.ts +13 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/flow-job.d.ts +19 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/flow-job.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/index.d.ts +28 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/index.js +29 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/ioredis-events.d.ts +8 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/ioredis-events.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/job-json.d.ts +47 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/job-json.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.d.ts +16 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/keep-jobs.d.ts +17 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/keep-jobs.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/metrics-options.d.ts +12 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/metrics-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/metrics.d.ts +9 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/metrics.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/minimal-job.d.ts +133 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/minimal-job.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/parent-message.d.ts +8 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/parent-message.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/parent.d.ts +20 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/parent.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts +97 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/queue-options.js +6 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/rate-limiter-options.d.ts +12 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/rate-limiter-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/redis-options.d.ts +8 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/redis-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/redis-streams.d.ts +4 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/redis-streams.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeat-options.d.ts +51 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeat-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeatable-job.d.ts +10 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeatable-job.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeatable-options.d.ts +7 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeatable-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-job-processor.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-job-processor.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-job.d.ts +13 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-job.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-options.d.ts +28 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/telemetry.d.ts +150 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/telemetry.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/worker-options.d.ts +133 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/worker-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addDelayedJob-6.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addDelayedJob-6.js +370 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-2.js +234 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addLog-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addLog-2.js +30 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addParentJob-4.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addParentJob-4.js +337 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addPrioritizedJob-8.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addPrioritizedJob-8.js +347 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addRepeatableJob-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addRepeatableJob-2.js +227 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addStandardJob-8.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/addStandardJob-8.js +351 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/changeDelay-4.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/changeDelay-4.js +104 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/changePriority-7.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/changePriority-7.js +119 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/cleanJobsInSet-3.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/cleanJobsInSet-3.js +347 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/drain-5.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/drain-5.js +255 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/extendLock-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/extendLock-2.js +27 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/extendLocks-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/extendLocks-1.js +43 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getCounts-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getCounts-1.js +39 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getCountsPerPriority-4.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getCountsPerPriority-4.js +43 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getJobScheduler-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getJobScheduler-1.js +20 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getRanges-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getRanges-1.js +70 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getRateLimitTtl-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getRateLimitTtl-1.js +36 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getState-8.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getState-8.js +70 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getStateV2-8.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getStateV2-8.js +54 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/index.d.ts +45 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/index.js +46 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/isFinished-3.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/isFinished-3.js +46 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/isJobInList-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/isJobInList-1.js +29 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/isMaxed-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/isMaxed-2.js +31 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveJobFromActiveToWait-10.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveJobFromActiveToWait-10.js +107 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveJobsToWait-8.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveJobsToWait-8.js +115 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-9.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-9.js +526 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToActive-11.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToActive-11.js +230 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToDelayed-8.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToDelayed-8.js +153 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToFinished-14.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToFinished-14.js +795 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-5.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-5.js +80 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/obliterate-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/obliterate-2.js +324 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/paginate-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/paginate-1.js +107 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/pause-7.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/pause-7.js +64 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/promote-9.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/promote-9.js +102 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/releaseLock-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/releaseLock-1.js +22 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeChildDependency-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeChildDependency-1.js +162 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeJob-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeJob-2.js +289 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeJobScheduler-3.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeJobScheduler-3.js +46 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeRepeatable-3.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeRepeatable-3.js +60 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/reprocessJob-8.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/reprocessJob-8.js +93 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/retryJob-11.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/retryJob-11.js +190 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/saveStacktrace-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/saveStacktrace-1.js +24 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateData-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateData-1.js +23 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateProgress-3.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateProgress-3.js +43 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateRepeatableJobMillis-1.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateRepeatableJobMillis-1.js +30 -0
- package/dist/node_modules/bullmq/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/dist/node_modules/bullmq/dist/esm/types/backoff-strategy.d.ts +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/backoff-strategy.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/finished-status.d.ts +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/finished-status.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/index.d.ts +8 -0
- package/dist/node_modules/bullmq/dist/esm/types/index.js +9 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-json-sandbox.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-json-sandbox.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-options.d.ts +81 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-scheduler-template-options.d.ts +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-scheduler-template-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-type.d.ts +3 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-type.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/minimal-queue.d.ts +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/minimal-queue.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/repeat-strategy.d.ts +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/repeat-strategy.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/utils.d.ts +72 -0
- package/dist/node_modules/bullmq/dist/esm/utils.js +263 -0
- package/dist/node_modules/bullmq/dist/esm/version.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/esm/version.js +2 -0
- package/dist/node_modules/bullmq/node_modules/.bin/semver +17 -0
- package/dist/node_modules/bullmq/node_modules/.bin/uuid +17 -0
- package/dist/node_modules/bullmq/package.json +1 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/plugin.d.ts +11 -0
- package/dist/server/plugin.js +63 -0
- package/package.json +18 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,1031 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Includes all the scripts needed by the queue and jobs.
|
|
3
|
+
*/
|
|
4
|
+
/*eslint-env node */
|
|
5
|
+
'use strict';
|
|
6
|
+
import { Packr } from 'msgpackr';
|
|
7
|
+
const packer = new Packr({
|
|
8
|
+
useRecords: false,
|
|
9
|
+
encodeUndefinedAsNil: true,
|
|
10
|
+
});
|
|
11
|
+
const pack = packer.pack;
|
|
12
|
+
import { ErrorCode } from '../enums';
|
|
13
|
+
import { array2obj, getParentKey, isRedisVersionLowerThan, objectToFlatArray, } from '../utils';
|
|
14
|
+
import { version as packageVersion } from '../version';
|
|
15
|
+
export class Scripts {
|
|
16
|
+
constructor(queue) {
|
|
17
|
+
this.queue = queue;
|
|
18
|
+
this.version = packageVersion;
|
|
19
|
+
const queueKeys = this.queue.keys;
|
|
20
|
+
this.moveToFinishedKeys = [
|
|
21
|
+
queueKeys.wait,
|
|
22
|
+
queueKeys.active,
|
|
23
|
+
queueKeys.prioritized,
|
|
24
|
+
queueKeys.events,
|
|
25
|
+
queueKeys.stalled,
|
|
26
|
+
queueKeys.limiter,
|
|
27
|
+
queueKeys.delayed,
|
|
28
|
+
queueKeys.paused,
|
|
29
|
+
queueKeys.meta,
|
|
30
|
+
queueKeys.pc,
|
|
31
|
+
undefined,
|
|
32
|
+
undefined,
|
|
33
|
+
undefined,
|
|
34
|
+
undefined,
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
execCommand(client, commandName, args) {
|
|
38
|
+
const commandNameWithVersion = `${commandName}:${this.version}`;
|
|
39
|
+
return client[commandNameWithVersion](args);
|
|
40
|
+
}
|
|
41
|
+
async isJobInList(listKey, jobId) {
|
|
42
|
+
const client = await this.queue.client;
|
|
43
|
+
let result;
|
|
44
|
+
if (isRedisVersionLowerThan(this.queue.redisVersion, '6.0.6')) {
|
|
45
|
+
result = await this.execCommand(client, 'isJobInList', [listKey, jobId]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
result = await client.lpos(listKey, jobId);
|
|
49
|
+
}
|
|
50
|
+
return Number.isInteger(result);
|
|
51
|
+
}
|
|
52
|
+
addDelayedJob(client, job, encodedOpts, args) {
|
|
53
|
+
const queueKeys = this.queue.keys;
|
|
54
|
+
const keys = [
|
|
55
|
+
queueKeys.marker,
|
|
56
|
+
queueKeys.meta,
|
|
57
|
+
queueKeys.id,
|
|
58
|
+
queueKeys.delayed,
|
|
59
|
+
queueKeys.completed,
|
|
60
|
+
queueKeys.events,
|
|
61
|
+
];
|
|
62
|
+
keys.push(pack(args), job.data, encodedOpts);
|
|
63
|
+
return this.execCommand(client, 'addDelayedJob', keys);
|
|
64
|
+
}
|
|
65
|
+
addPrioritizedJob(client, job, encodedOpts, args) {
|
|
66
|
+
const queueKeys = this.queue.keys;
|
|
67
|
+
const keys = [
|
|
68
|
+
queueKeys.marker,
|
|
69
|
+
queueKeys.meta,
|
|
70
|
+
queueKeys.id,
|
|
71
|
+
queueKeys.prioritized,
|
|
72
|
+
queueKeys.completed,
|
|
73
|
+
queueKeys.active,
|
|
74
|
+
queueKeys.events,
|
|
75
|
+
queueKeys.pc,
|
|
76
|
+
];
|
|
77
|
+
keys.push(pack(args), job.data, encodedOpts);
|
|
78
|
+
return this.execCommand(client, 'addPrioritizedJob', keys);
|
|
79
|
+
}
|
|
80
|
+
addParentJob(client, job, encodedOpts, args) {
|
|
81
|
+
const queueKeys = this.queue.keys;
|
|
82
|
+
const keys = [
|
|
83
|
+
queueKeys.meta,
|
|
84
|
+
queueKeys.id,
|
|
85
|
+
queueKeys.completed,
|
|
86
|
+
queueKeys.events,
|
|
87
|
+
];
|
|
88
|
+
keys.push(pack(args), job.data, encodedOpts);
|
|
89
|
+
return this.execCommand(client, 'addParentJob', keys);
|
|
90
|
+
}
|
|
91
|
+
addStandardJob(client, job, encodedOpts, args) {
|
|
92
|
+
const queueKeys = this.queue.keys;
|
|
93
|
+
const keys = [
|
|
94
|
+
queueKeys.wait,
|
|
95
|
+
queueKeys.paused,
|
|
96
|
+
queueKeys.meta,
|
|
97
|
+
queueKeys.id,
|
|
98
|
+
queueKeys.completed,
|
|
99
|
+
queueKeys.active,
|
|
100
|
+
queueKeys.events,
|
|
101
|
+
queueKeys.marker,
|
|
102
|
+
];
|
|
103
|
+
keys.push(pack(args), job.data, encodedOpts);
|
|
104
|
+
return this.execCommand(client, 'addStandardJob', keys);
|
|
105
|
+
}
|
|
106
|
+
async addJob(client, job, opts, jobId, parentOpts = {}) {
|
|
107
|
+
const queueKeys = this.queue.keys;
|
|
108
|
+
const parent = job.parent
|
|
109
|
+
? Object.assign(Object.assign({}, job.parent), { fpof: opts.fpof, rdof: opts.rdof, idof: opts.idof }) : null;
|
|
110
|
+
const args = [
|
|
111
|
+
queueKeys[''],
|
|
112
|
+
typeof jobId !== 'undefined' ? jobId : '',
|
|
113
|
+
job.name,
|
|
114
|
+
job.timestamp,
|
|
115
|
+
job.parentKey || null,
|
|
116
|
+
parentOpts.waitChildrenKey || null,
|
|
117
|
+
parentOpts.parentDependenciesKey || null,
|
|
118
|
+
parent,
|
|
119
|
+
job.repeatJobKey,
|
|
120
|
+
job.deduplicationId ? `${queueKeys.de}:${job.deduplicationId}` : null,
|
|
121
|
+
];
|
|
122
|
+
let encodedOpts;
|
|
123
|
+
if (opts.repeat) {
|
|
124
|
+
const repeat = Object.assign({}, opts.repeat);
|
|
125
|
+
if (repeat.startDate) {
|
|
126
|
+
repeat.startDate = +new Date(repeat.startDate);
|
|
127
|
+
}
|
|
128
|
+
if (repeat.endDate) {
|
|
129
|
+
repeat.endDate = +new Date(repeat.endDate);
|
|
130
|
+
}
|
|
131
|
+
encodedOpts = pack(Object.assign(Object.assign({}, opts), { repeat }));
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
encodedOpts = pack(opts);
|
|
135
|
+
}
|
|
136
|
+
let result;
|
|
137
|
+
if (parentOpts.waitChildrenKey) {
|
|
138
|
+
result = await this.addParentJob(client, job, encodedOpts, args);
|
|
139
|
+
}
|
|
140
|
+
else if (typeof opts.delay == 'number') {
|
|
141
|
+
result = await this.addDelayedJob(client, job, encodedOpts, args);
|
|
142
|
+
}
|
|
143
|
+
else if (opts.priority) {
|
|
144
|
+
result = await this.addPrioritizedJob(client, job, encodedOpts, args);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
result = await this.addStandardJob(client, job, encodedOpts, args);
|
|
148
|
+
}
|
|
149
|
+
if (result < 0) {
|
|
150
|
+
throw this.finishedErrors({
|
|
151
|
+
code: result,
|
|
152
|
+
parentKey: parentOpts.parentKey,
|
|
153
|
+
command: 'addJob',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
pauseArgs(pause) {
|
|
159
|
+
let src = 'wait', dst = 'paused';
|
|
160
|
+
if (!pause) {
|
|
161
|
+
src = 'paused';
|
|
162
|
+
dst = 'wait';
|
|
163
|
+
}
|
|
164
|
+
const keys = [src, dst, 'meta', 'prioritized'].map((name) => this.queue.toKey(name));
|
|
165
|
+
keys.push(this.queue.keys.events, this.queue.keys.delayed, this.queue.keys.marker);
|
|
166
|
+
const args = [pause ? 'paused' : 'resumed'];
|
|
167
|
+
return keys.concat(args);
|
|
168
|
+
}
|
|
169
|
+
async pause(pause) {
|
|
170
|
+
const client = await this.queue.client;
|
|
171
|
+
const args = this.pauseArgs(pause);
|
|
172
|
+
return this.execCommand(client, 'pause', args);
|
|
173
|
+
}
|
|
174
|
+
addRepeatableJobArgs(customKey, nextMillis, opts, legacyCustomKey) {
|
|
175
|
+
const queueKeys = this.queue.keys;
|
|
176
|
+
const keys = [
|
|
177
|
+
queueKeys.repeat,
|
|
178
|
+
queueKeys.delayed,
|
|
179
|
+
];
|
|
180
|
+
const args = [
|
|
181
|
+
nextMillis,
|
|
182
|
+
pack(opts),
|
|
183
|
+
legacyCustomKey,
|
|
184
|
+
customKey,
|
|
185
|
+
queueKeys[''],
|
|
186
|
+
];
|
|
187
|
+
return keys.concat(args);
|
|
188
|
+
}
|
|
189
|
+
async addRepeatableJob(customKey, nextMillis, opts, legacyCustomKey) {
|
|
190
|
+
const client = await this.queue.client;
|
|
191
|
+
const args = this.addRepeatableJobArgs(customKey, nextMillis, opts, legacyCustomKey);
|
|
192
|
+
return this.execCommand(client, 'addRepeatableJob', args);
|
|
193
|
+
}
|
|
194
|
+
async addJobScheduler(client, jobSchedulerId, nextMillis, templateData, templateOpts, opts) {
|
|
195
|
+
const queueKeys = this.queue.keys;
|
|
196
|
+
const keys = [
|
|
197
|
+
queueKeys.repeat,
|
|
198
|
+
queueKeys.delayed,
|
|
199
|
+
];
|
|
200
|
+
const args = [
|
|
201
|
+
nextMillis,
|
|
202
|
+
pack(opts),
|
|
203
|
+
jobSchedulerId,
|
|
204
|
+
templateData,
|
|
205
|
+
pack(templateOpts),
|
|
206
|
+
queueKeys[''],
|
|
207
|
+
];
|
|
208
|
+
return this.execCommand(client, 'addJobScheduler', keys.concat(args));
|
|
209
|
+
}
|
|
210
|
+
async updateRepeatableJobMillis(client, customKey, nextMillis, legacyCustomKey) {
|
|
211
|
+
const args = [
|
|
212
|
+
this.queue.keys.repeat,
|
|
213
|
+
nextMillis,
|
|
214
|
+
customKey,
|
|
215
|
+
legacyCustomKey,
|
|
216
|
+
];
|
|
217
|
+
return this.execCommand(client, 'updateRepeatableJobMillis', args);
|
|
218
|
+
}
|
|
219
|
+
async updateJobSchedulerNextMillis(client, jobSchedulerId, nextMillis) {
|
|
220
|
+
return client.zadd(this.queue.keys.repeat, nextMillis, jobSchedulerId);
|
|
221
|
+
}
|
|
222
|
+
removeRepeatableArgs(legacyRepeatJobId, repeatConcatOptions, repeatJobKey) {
|
|
223
|
+
const queueKeys = this.queue.keys;
|
|
224
|
+
const keys = [queueKeys.repeat, queueKeys.delayed, queueKeys.events];
|
|
225
|
+
const args = [
|
|
226
|
+
legacyRepeatJobId,
|
|
227
|
+
this.getRepeatConcatOptions(repeatConcatOptions, repeatJobKey),
|
|
228
|
+
repeatJobKey,
|
|
229
|
+
queueKeys[''],
|
|
230
|
+
];
|
|
231
|
+
return keys.concat(args);
|
|
232
|
+
}
|
|
233
|
+
// TODO: remove this check in next breaking change
|
|
234
|
+
getRepeatConcatOptions(repeatConcatOptions, repeatJobKey) {
|
|
235
|
+
if (repeatJobKey && repeatJobKey.split(':').length > 2) {
|
|
236
|
+
return repeatJobKey;
|
|
237
|
+
}
|
|
238
|
+
return repeatConcatOptions;
|
|
239
|
+
}
|
|
240
|
+
async removeRepeatable(legacyRepeatJobId, repeatConcatOptions, repeatJobKey) {
|
|
241
|
+
const client = await this.queue.client;
|
|
242
|
+
const args = this.removeRepeatableArgs(legacyRepeatJobId, repeatConcatOptions, repeatJobKey);
|
|
243
|
+
return this.execCommand(client, 'removeRepeatable', args);
|
|
244
|
+
}
|
|
245
|
+
async removeJobScheduler(jobSchedulerId) {
|
|
246
|
+
const client = await this.queue.client;
|
|
247
|
+
const queueKeys = this.queue.keys;
|
|
248
|
+
const keys = [queueKeys.repeat, queueKeys.delayed, queueKeys.events];
|
|
249
|
+
const args = [jobSchedulerId, queueKeys['']];
|
|
250
|
+
return this.execCommand(client, 'removeJobScheduler', keys.concat(args));
|
|
251
|
+
}
|
|
252
|
+
removeArgs(jobId, removeChildren) {
|
|
253
|
+
const keys = ['', 'meta'].map(name => this.queue.toKey(name));
|
|
254
|
+
const args = [jobId, removeChildren ? 1 : 0];
|
|
255
|
+
return keys.concat(args);
|
|
256
|
+
}
|
|
257
|
+
async remove(jobId, removeChildren) {
|
|
258
|
+
const client = await this.queue.client;
|
|
259
|
+
const args = this.removeArgs(jobId, removeChildren);
|
|
260
|
+
const result = await this.execCommand(client, 'removeJob', args);
|
|
261
|
+
if (result < 0) {
|
|
262
|
+
throw this.finishedErrors({
|
|
263
|
+
code: result,
|
|
264
|
+
jobId,
|
|
265
|
+
command: 'removeJob',
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
async extendLock(jobId, token, duration, client) {
|
|
271
|
+
client = client || (await this.queue.client);
|
|
272
|
+
const args = [
|
|
273
|
+
this.queue.toKey(jobId) + ':lock',
|
|
274
|
+
this.queue.keys.stalled,
|
|
275
|
+
token,
|
|
276
|
+
duration,
|
|
277
|
+
jobId,
|
|
278
|
+
];
|
|
279
|
+
return this.execCommand(client, 'extendLock', args);
|
|
280
|
+
}
|
|
281
|
+
async extendLocks(jobIds, tokens, duration) {
|
|
282
|
+
const client = await this.queue.client;
|
|
283
|
+
const args = [
|
|
284
|
+
this.queue.keys.stalled,
|
|
285
|
+
this.queue.toKey(''),
|
|
286
|
+
pack(tokens),
|
|
287
|
+
pack(jobIds),
|
|
288
|
+
duration,
|
|
289
|
+
];
|
|
290
|
+
return this.execCommand(client, 'extendLocks', args);
|
|
291
|
+
}
|
|
292
|
+
async updateData(job, data) {
|
|
293
|
+
const client = await this.queue.client;
|
|
294
|
+
const keys = [this.queue.toKey(job.id)];
|
|
295
|
+
const dataJson = JSON.stringify(data);
|
|
296
|
+
const result = await this.execCommand(client, 'updateData', keys.concat([dataJson]));
|
|
297
|
+
if (result < 0) {
|
|
298
|
+
throw this.finishedErrors({
|
|
299
|
+
code: result,
|
|
300
|
+
jobId: job.id,
|
|
301
|
+
command: 'updateData',
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
async updateProgress(jobId, progress) {
|
|
306
|
+
const client = await this.queue.client;
|
|
307
|
+
const keys = [
|
|
308
|
+
this.queue.toKey(jobId),
|
|
309
|
+
this.queue.keys.events,
|
|
310
|
+
this.queue.keys.meta,
|
|
311
|
+
];
|
|
312
|
+
const progressJson = JSON.stringify(progress);
|
|
313
|
+
const result = await this.execCommand(client, 'updateProgress', keys.concat([jobId, progressJson]));
|
|
314
|
+
if (result < 0) {
|
|
315
|
+
throw this.finishedErrors({
|
|
316
|
+
code: result,
|
|
317
|
+
jobId,
|
|
318
|
+
command: 'updateProgress',
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
async addLog(jobId, logRow, keepLogs) {
|
|
323
|
+
const client = await this.queue.client;
|
|
324
|
+
const keys = [
|
|
325
|
+
this.queue.toKey(jobId),
|
|
326
|
+
this.queue.toKey(jobId) + ':logs',
|
|
327
|
+
];
|
|
328
|
+
const result = await this.execCommand(client, 'addLog', keys.concat([jobId, logRow, keepLogs ? keepLogs : '']));
|
|
329
|
+
if (result < 0) {
|
|
330
|
+
throw this.finishedErrors({
|
|
331
|
+
code: result,
|
|
332
|
+
jobId,
|
|
333
|
+
command: 'addLog',
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
return result;
|
|
337
|
+
}
|
|
338
|
+
moveToFinishedArgs(job, val, propVal, shouldRemove, target, token, timestamp, fetchNext = true, fieldsToUpdate) {
|
|
339
|
+
var _a, _b, _c, _d, _e, _f;
|
|
340
|
+
const queueKeys = this.queue.keys;
|
|
341
|
+
const opts = this.queue.opts;
|
|
342
|
+
const workerKeepJobs = target === 'completed' ? opts.removeOnComplete : opts.removeOnFail;
|
|
343
|
+
const metricsKey = this.queue.toKey(`metrics:${target}`);
|
|
344
|
+
const keys = this.moveToFinishedKeys;
|
|
345
|
+
keys[10] = queueKeys[target];
|
|
346
|
+
keys[11] = this.queue.toKey((_a = job.id) !== null && _a !== void 0 ? _a : '');
|
|
347
|
+
keys[12] = metricsKey;
|
|
348
|
+
keys[13] = this.queue.keys.marker;
|
|
349
|
+
const keepJobs = this.getKeepJobs(shouldRemove, workerKeepJobs);
|
|
350
|
+
const args = [
|
|
351
|
+
job.id,
|
|
352
|
+
timestamp,
|
|
353
|
+
propVal,
|
|
354
|
+
typeof val === 'undefined' ? 'null' : val,
|
|
355
|
+
target,
|
|
356
|
+
!fetchNext || this.queue.closing ? 0 : 1,
|
|
357
|
+
queueKeys[''],
|
|
358
|
+
pack({
|
|
359
|
+
token,
|
|
360
|
+
keepJobs,
|
|
361
|
+
limiter: opts.limiter,
|
|
362
|
+
lockDuration: opts.lockDuration,
|
|
363
|
+
attempts: job.opts.attempts,
|
|
364
|
+
maxMetricsSize: ((_b = opts.metrics) === null || _b === void 0 ? void 0 : _b.maxDataPoints)
|
|
365
|
+
? (_c = opts.metrics) === null || _c === void 0 ? void 0 : _c.maxDataPoints
|
|
366
|
+
: '',
|
|
367
|
+
fpof: !!((_d = job.opts) === null || _d === void 0 ? void 0 : _d.failParentOnFailure),
|
|
368
|
+
idof: !!((_e = job.opts) === null || _e === void 0 ? void 0 : _e.ignoreDependencyOnFailure),
|
|
369
|
+
rdof: !!((_f = job.opts) === null || _f === void 0 ? void 0 : _f.removeDependencyOnFailure),
|
|
370
|
+
}),
|
|
371
|
+
fieldsToUpdate ? pack(objectToFlatArray(fieldsToUpdate)) : void 0,
|
|
372
|
+
];
|
|
373
|
+
return keys.concat(args);
|
|
374
|
+
}
|
|
375
|
+
getKeepJobs(shouldRemove, workerKeepJobs) {
|
|
376
|
+
if (typeof shouldRemove === 'undefined') {
|
|
377
|
+
return workerKeepJobs || { count: shouldRemove ? 0 : -1 };
|
|
378
|
+
}
|
|
379
|
+
return typeof shouldRemove === 'object'
|
|
380
|
+
? shouldRemove
|
|
381
|
+
: typeof shouldRemove === 'number'
|
|
382
|
+
? { count: shouldRemove }
|
|
383
|
+
: { count: shouldRemove ? 0 : -1 };
|
|
384
|
+
}
|
|
385
|
+
async moveToFinished(jobId, args) {
|
|
386
|
+
const client = await this.queue.client;
|
|
387
|
+
const result = await this.execCommand(client, 'moveToFinished', args);
|
|
388
|
+
if (result < 0) {
|
|
389
|
+
throw this.finishedErrors({
|
|
390
|
+
code: result,
|
|
391
|
+
jobId,
|
|
392
|
+
command: 'moveToFinished',
|
|
393
|
+
state: 'active',
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
if (typeof result !== 'undefined') {
|
|
398
|
+
return raw2NextJobData(result);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
drainArgs(delayed) {
|
|
403
|
+
const queueKeys = this.queue.keys;
|
|
404
|
+
const keys = [
|
|
405
|
+
queueKeys.wait,
|
|
406
|
+
queueKeys.paused,
|
|
407
|
+
delayed ? queueKeys.delayed : '',
|
|
408
|
+
queueKeys.prioritized,
|
|
409
|
+
queueKeys.repeat,
|
|
410
|
+
];
|
|
411
|
+
const args = [queueKeys['']];
|
|
412
|
+
return keys.concat(args);
|
|
413
|
+
}
|
|
414
|
+
async drain(delayed) {
|
|
415
|
+
const client = await this.queue.client;
|
|
416
|
+
const args = this.drainArgs(delayed);
|
|
417
|
+
return this.execCommand(client, 'drain', args);
|
|
418
|
+
}
|
|
419
|
+
removeChildDependencyArgs(jobId, parentKey) {
|
|
420
|
+
const queueKeys = this.queue.keys;
|
|
421
|
+
const keys = [queueKeys['']];
|
|
422
|
+
const args = [this.queue.toKey(jobId), parentKey];
|
|
423
|
+
return keys.concat(args);
|
|
424
|
+
}
|
|
425
|
+
async removeChildDependency(jobId, parentKey) {
|
|
426
|
+
const client = await this.queue.client;
|
|
427
|
+
const args = this.removeChildDependencyArgs(jobId, parentKey);
|
|
428
|
+
const result = await this.execCommand(client, 'removeChildDependency', args);
|
|
429
|
+
switch (result) {
|
|
430
|
+
case 0:
|
|
431
|
+
return true;
|
|
432
|
+
case 1:
|
|
433
|
+
return false;
|
|
434
|
+
default:
|
|
435
|
+
throw this.finishedErrors({
|
|
436
|
+
code: result,
|
|
437
|
+
jobId,
|
|
438
|
+
parentKey,
|
|
439
|
+
command: 'removeChildDependency',
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
getRangesArgs(types, start, end, asc) {
|
|
444
|
+
const queueKeys = this.queue.keys;
|
|
445
|
+
const transformedTypes = types.map(type => {
|
|
446
|
+
return type === 'waiting' ? 'wait' : type;
|
|
447
|
+
});
|
|
448
|
+
const keys = [queueKeys['']];
|
|
449
|
+
const args = [start, end, asc ? '1' : '0', ...transformedTypes];
|
|
450
|
+
return keys.concat(args);
|
|
451
|
+
}
|
|
452
|
+
async getRanges(types, start = 0, end = 1, asc = false) {
|
|
453
|
+
const client = await this.queue.client;
|
|
454
|
+
const args = this.getRangesArgs(types, start, end, asc);
|
|
455
|
+
return await this.execCommand(client, 'getRanges', args);
|
|
456
|
+
}
|
|
457
|
+
getCountsArgs(types) {
|
|
458
|
+
const queueKeys = this.queue.keys;
|
|
459
|
+
const transformedTypes = types.map(type => {
|
|
460
|
+
return type === 'waiting' ? 'wait' : type;
|
|
461
|
+
});
|
|
462
|
+
const keys = [queueKeys['']];
|
|
463
|
+
const args = [...transformedTypes];
|
|
464
|
+
return keys.concat(args);
|
|
465
|
+
}
|
|
466
|
+
async getCounts(types) {
|
|
467
|
+
const client = await this.queue.client;
|
|
468
|
+
const args = this.getCountsArgs(types);
|
|
469
|
+
return await this.execCommand(client, 'getCounts', args);
|
|
470
|
+
}
|
|
471
|
+
getCountsPerPriorityArgs(priorities) {
|
|
472
|
+
const keys = [
|
|
473
|
+
this.queue.keys.wait,
|
|
474
|
+
this.queue.keys.paused,
|
|
475
|
+
this.queue.keys.meta,
|
|
476
|
+
this.queue.keys.prioritized,
|
|
477
|
+
];
|
|
478
|
+
const args = priorities;
|
|
479
|
+
return keys.concat(args);
|
|
480
|
+
}
|
|
481
|
+
async getCountsPerPriority(priorities) {
|
|
482
|
+
const client = await this.queue.client;
|
|
483
|
+
const args = this.getCountsPerPriorityArgs(priorities);
|
|
484
|
+
return await this.execCommand(client, 'getCountsPerPriority', args);
|
|
485
|
+
}
|
|
486
|
+
moveToCompletedArgs(job, returnvalue, removeOnComplete, token, fetchNext = false) {
|
|
487
|
+
const timestamp = Date.now();
|
|
488
|
+
return this.moveToFinishedArgs(job, returnvalue, 'returnvalue', removeOnComplete, 'completed', token, timestamp, fetchNext);
|
|
489
|
+
}
|
|
490
|
+
moveToFailedArgs(job, failedReason, removeOnFailed, token, fetchNext = false, fieldsToUpdate) {
|
|
491
|
+
const timestamp = Date.now();
|
|
492
|
+
return this.moveToFinishedArgs(job, failedReason, 'failedReason', removeOnFailed, 'failed', token, timestamp, fetchNext, fieldsToUpdate);
|
|
493
|
+
}
|
|
494
|
+
async isFinished(jobId, returnValue = false) {
|
|
495
|
+
const client = await this.queue.client;
|
|
496
|
+
const keys = ['completed', 'failed', jobId].map((key) => {
|
|
497
|
+
return this.queue.toKey(key);
|
|
498
|
+
});
|
|
499
|
+
return this.execCommand(client, 'isFinished', keys.concat([jobId, returnValue ? '1' : '']));
|
|
500
|
+
}
|
|
501
|
+
async getState(jobId) {
|
|
502
|
+
const client = await this.queue.client;
|
|
503
|
+
const keys = [
|
|
504
|
+
'completed',
|
|
505
|
+
'failed',
|
|
506
|
+
'delayed',
|
|
507
|
+
'active',
|
|
508
|
+
'wait',
|
|
509
|
+
'paused',
|
|
510
|
+
'waiting-children',
|
|
511
|
+
'prioritized',
|
|
512
|
+
].map((key) => {
|
|
513
|
+
return this.queue.toKey(key);
|
|
514
|
+
});
|
|
515
|
+
if (isRedisVersionLowerThan(this.queue.redisVersion, '6.0.6')) {
|
|
516
|
+
return this.execCommand(client, 'getState', keys.concat([jobId]));
|
|
517
|
+
}
|
|
518
|
+
return this.execCommand(client, 'getStateV2', keys.concat([jobId]));
|
|
519
|
+
}
|
|
520
|
+
async changeDelay(jobId, delay) {
|
|
521
|
+
const client = await this.queue.client;
|
|
522
|
+
const args = this.changeDelayArgs(jobId, delay);
|
|
523
|
+
const result = await this.execCommand(client, 'changeDelay', args);
|
|
524
|
+
if (result < 0) {
|
|
525
|
+
throw this.finishedErrors({
|
|
526
|
+
code: result,
|
|
527
|
+
jobId,
|
|
528
|
+
command: 'changeDelay',
|
|
529
|
+
state: 'delayed',
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
changeDelayArgs(jobId, delay) {
|
|
534
|
+
const timestamp = Date.now();
|
|
535
|
+
const keys = [
|
|
536
|
+
this.queue.keys.delayed,
|
|
537
|
+
this.queue.keys.meta,
|
|
538
|
+
this.queue.keys.marker,
|
|
539
|
+
this.queue.keys.events,
|
|
540
|
+
];
|
|
541
|
+
return keys.concat([
|
|
542
|
+
delay,
|
|
543
|
+
JSON.stringify(timestamp),
|
|
544
|
+
jobId,
|
|
545
|
+
this.queue.toKey(jobId),
|
|
546
|
+
]);
|
|
547
|
+
}
|
|
548
|
+
async changePriority(jobId, priority = 0, lifo = false) {
|
|
549
|
+
const client = await this.queue.client;
|
|
550
|
+
const args = this.changePriorityArgs(jobId, priority, lifo);
|
|
551
|
+
const result = await this.execCommand(client, 'changePriority', args);
|
|
552
|
+
if (result < 0) {
|
|
553
|
+
throw this.finishedErrors({
|
|
554
|
+
code: result,
|
|
555
|
+
jobId,
|
|
556
|
+
command: 'changePriority',
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
changePriorityArgs(jobId, priority = 0, lifo = false) {
|
|
561
|
+
const keys = [
|
|
562
|
+
this.queue.keys.wait,
|
|
563
|
+
this.queue.keys.paused,
|
|
564
|
+
this.queue.keys.meta,
|
|
565
|
+
this.queue.keys.prioritized,
|
|
566
|
+
this.queue.keys.active,
|
|
567
|
+
this.queue.keys.pc,
|
|
568
|
+
this.queue.keys.marker,
|
|
569
|
+
];
|
|
570
|
+
return keys.concat([priority, this.queue.toKey(''), jobId, lifo ? 1 : 0]);
|
|
571
|
+
}
|
|
572
|
+
moveToDelayedArgs(jobId, timestamp, token, delay, opts = {}) {
|
|
573
|
+
const queueKeys = this.queue.keys;
|
|
574
|
+
const keys = [
|
|
575
|
+
queueKeys.marker,
|
|
576
|
+
queueKeys.active,
|
|
577
|
+
queueKeys.prioritized,
|
|
578
|
+
queueKeys.delayed,
|
|
579
|
+
this.queue.toKey(jobId),
|
|
580
|
+
queueKeys.events,
|
|
581
|
+
queueKeys.meta,
|
|
582
|
+
queueKeys.stalled,
|
|
583
|
+
];
|
|
584
|
+
return keys.concat([
|
|
585
|
+
this.queue.keys[''],
|
|
586
|
+
timestamp,
|
|
587
|
+
jobId,
|
|
588
|
+
token,
|
|
589
|
+
delay,
|
|
590
|
+
opts.skipAttempt ? '1' : '0',
|
|
591
|
+
opts.fieldsToUpdate
|
|
592
|
+
? pack(objectToFlatArray(opts.fieldsToUpdate))
|
|
593
|
+
: void 0,
|
|
594
|
+
]);
|
|
595
|
+
}
|
|
596
|
+
moveToWaitingChildrenArgs(jobId, token, opts) {
|
|
597
|
+
const timestamp = Date.now();
|
|
598
|
+
const childKey = getParentKey(opts.child);
|
|
599
|
+
const keys = [
|
|
600
|
+
`${jobId}:lock`,
|
|
601
|
+
'active',
|
|
602
|
+
'waiting-children',
|
|
603
|
+
jobId,
|
|
604
|
+
'stalled',
|
|
605
|
+
].map(name => {
|
|
606
|
+
return this.queue.toKey(name);
|
|
607
|
+
});
|
|
608
|
+
return keys.concat([
|
|
609
|
+
token,
|
|
610
|
+
childKey !== null && childKey !== void 0 ? childKey : '',
|
|
611
|
+
JSON.stringify(timestamp),
|
|
612
|
+
jobId,
|
|
613
|
+
]);
|
|
614
|
+
}
|
|
615
|
+
isMaxedArgs() {
|
|
616
|
+
const queueKeys = this.queue.keys;
|
|
617
|
+
const keys = [queueKeys.meta, queueKeys.active];
|
|
618
|
+
return keys;
|
|
619
|
+
}
|
|
620
|
+
async isMaxed() {
|
|
621
|
+
const client = await this.queue.client;
|
|
622
|
+
const args = this.isMaxedArgs();
|
|
623
|
+
return !!(await this.execCommand(client, 'isMaxed', args));
|
|
624
|
+
}
|
|
625
|
+
async moveToDelayed(jobId, timestamp, delay, token = '0', opts = {}) {
|
|
626
|
+
const client = await this.queue.client;
|
|
627
|
+
const args = this.moveToDelayedArgs(jobId, timestamp, token, delay, opts);
|
|
628
|
+
const result = await this.execCommand(client, 'moveToDelayed', args);
|
|
629
|
+
if (result < 0) {
|
|
630
|
+
throw this.finishedErrors({
|
|
631
|
+
code: result,
|
|
632
|
+
jobId,
|
|
633
|
+
command: 'moveToDelayed',
|
|
634
|
+
state: 'active',
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Move parent job to waiting-children state.
|
|
640
|
+
*
|
|
641
|
+
* @returns true if job is successfully moved, false if there are pending dependencies.
|
|
642
|
+
* @throws JobNotExist
|
|
643
|
+
* This exception is thrown if jobId is missing.
|
|
644
|
+
* @throws JobLockNotExist
|
|
645
|
+
* This exception is thrown if job lock is missing.
|
|
646
|
+
* @throws JobNotInState
|
|
647
|
+
* This exception is thrown if job is not in active state.
|
|
648
|
+
*/
|
|
649
|
+
async moveToWaitingChildren(jobId, token, opts = {}) {
|
|
650
|
+
const client = await this.queue.client;
|
|
651
|
+
const args = this.moveToWaitingChildrenArgs(jobId, token, opts);
|
|
652
|
+
const result = await this.execCommand(client, 'moveToWaitingChildren', args);
|
|
653
|
+
switch (result) {
|
|
654
|
+
case 0:
|
|
655
|
+
return true;
|
|
656
|
+
case 1:
|
|
657
|
+
return false;
|
|
658
|
+
default:
|
|
659
|
+
throw this.finishedErrors({
|
|
660
|
+
code: result,
|
|
661
|
+
jobId,
|
|
662
|
+
command: 'moveToWaitingChildren',
|
|
663
|
+
state: 'active',
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
getRateLimitTtlArgs(maxJobs) {
|
|
668
|
+
const keys = [this.queue.keys.limiter];
|
|
669
|
+
return keys.concat([maxJobs !== null && maxJobs !== void 0 ? maxJobs : '0']);
|
|
670
|
+
}
|
|
671
|
+
async getRateLimitTtl(maxJobs) {
|
|
672
|
+
const client = await this.queue.client;
|
|
673
|
+
const args = this.getRateLimitTtlArgs(maxJobs);
|
|
674
|
+
return this.execCommand(client, 'getRateLimitTtl', args);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Remove jobs in a specific state.
|
|
678
|
+
*
|
|
679
|
+
* @returns Id jobs from the deleted records.
|
|
680
|
+
*/
|
|
681
|
+
async cleanJobsInSet(set, timestamp, limit = 0) {
|
|
682
|
+
const client = await this.queue.client;
|
|
683
|
+
return this.execCommand(client, 'cleanJobsInSet', [
|
|
684
|
+
this.queue.toKey(set),
|
|
685
|
+
this.queue.toKey('events'),
|
|
686
|
+
this.queue.toKey('repeat'),
|
|
687
|
+
this.queue.toKey(''),
|
|
688
|
+
timestamp,
|
|
689
|
+
limit,
|
|
690
|
+
set,
|
|
691
|
+
]);
|
|
692
|
+
}
|
|
693
|
+
getJobSchedulerArgs(id) {
|
|
694
|
+
const keys = [this.queue.keys.repeat];
|
|
695
|
+
return keys.concat([id]);
|
|
696
|
+
}
|
|
697
|
+
async getJobScheduler(id) {
|
|
698
|
+
const client = await this.queue.client;
|
|
699
|
+
const args = this.getJobSchedulerArgs(id);
|
|
700
|
+
return this.execCommand(client, 'getJobScheduler', args);
|
|
701
|
+
}
|
|
702
|
+
retryJobArgs(jobId, lifo, token, fieldsToUpdate) {
|
|
703
|
+
const keys = [
|
|
704
|
+
this.queue.keys.active,
|
|
705
|
+
this.queue.keys.wait,
|
|
706
|
+
this.queue.keys.paused,
|
|
707
|
+
this.queue.toKey(jobId),
|
|
708
|
+
this.queue.keys.meta,
|
|
709
|
+
this.queue.keys.events,
|
|
710
|
+
this.queue.keys.delayed,
|
|
711
|
+
this.queue.keys.prioritized,
|
|
712
|
+
this.queue.keys.pc,
|
|
713
|
+
this.queue.keys.marker,
|
|
714
|
+
this.queue.keys.stalled,
|
|
715
|
+
];
|
|
716
|
+
const pushCmd = (lifo ? 'R' : 'L') + 'PUSH';
|
|
717
|
+
return keys.concat([
|
|
718
|
+
this.queue.toKey(''),
|
|
719
|
+
Date.now(),
|
|
720
|
+
pushCmd,
|
|
721
|
+
jobId,
|
|
722
|
+
token,
|
|
723
|
+
fieldsToUpdate ? pack(objectToFlatArray(fieldsToUpdate)) : void 0,
|
|
724
|
+
]);
|
|
725
|
+
}
|
|
726
|
+
async retryJob(jobId, lifo, token, fieldsToUpdate) {
|
|
727
|
+
const client = await this.queue.client;
|
|
728
|
+
const args = this.retryJobArgs(jobId, lifo, token, fieldsToUpdate);
|
|
729
|
+
const result = await this.execCommand(client, 'retryJob', args);
|
|
730
|
+
if (result < 0) {
|
|
731
|
+
throw this.finishedErrors({
|
|
732
|
+
code: result,
|
|
733
|
+
jobId,
|
|
734
|
+
command: 'retryJob',
|
|
735
|
+
state: 'active',
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
moveJobsToWaitArgs(state, count, timestamp) {
|
|
740
|
+
const keys = [
|
|
741
|
+
this.queue.toKey(''),
|
|
742
|
+
this.queue.keys.events,
|
|
743
|
+
this.queue.toKey(state),
|
|
744
|
+
this.queue.toKey('wait'),
|
|
745
|
+
this.queue.toKey('paused'),
|
|
746
|
+
this.queue.keys.meta,
|
|
747
|
+
this.queue.keys.active,
|
|
748
|
+
this.queue.keys.marker,
|
|
749
|
+
];
|
|
750
|
+
const args = [count, timestamp, state];
|
|
751
|
+
return keys.concat(args);
|
|
752
|
+
}
|
|
753
|
+
async retryJobs(state = 'failed', count = 1000, timestamp = new Date().getTime()) {
|
|
754
|
+
const client = await this.queue.client;
|
|
755
|
+
const args = this.moveJobsToWaitArgs(state, count, timestamp);
|
|
756
|
+
return this.execCommand(client, 'moveJobsToWait', args);
|
|
757
|
+
}
|
|
758
|
+
async promoteJobs(count = 1000) {
|
|
759
|
+
const client = await this.queue.client;
|
|
760
|
+
const args = this.moveJobsToWaitArgs('delayed', count, Number.MAX_VALUE);
|
|
761
|
+
return this.execCommand(client, 'moveJobsToWait', args);
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Attempts to reprocess a job
|
|
765
|
+
*
|
|
766
|
+
* @param job -
|
|
767
|
+
* @param state - The expected job state. If the job is not found
|
|
768
|
+
* on the provided state, then it's not reprocessed. Supported states: 'failed', 'completed'
|
|
769
|
+
*
|
|
770
|
+
* @returns Returns a promise that evaluates to a return code:
|
|
771
|
+
* 1 means the operation was a success
|
|
772
|
+
* 0 means the job does not exist
|
|
773
|
+
* -1 means the job is currently locked and can't be retried.
|
|
774
|
+
* -2 means the job was not found in the expected set
|
|
775
|
+
*/
|
|
776
|
+
async reprocessJob(job, state) {
|
|
777
|
+
const client = await this.queue.client;
|
|
778
|
+
const keys = [
|
|
779
|
+
this.queue.toKey(job.id),
|
|
780
|
+
this.queue.keys.events,
|
|
781
|
+
this.queue.toKey(state),
|
|
782
|
+
this.queue.keys.wait,
|
|
783
|
+
this.queue.keys.meta,
|
|
784
|
+
this.queue.keys.paused,
|
|
785
|
+
this.queue.keys.active,
|
|
786
|
+
this.queue.keys.marker,
|
|
787
|
+
];
|
|
788
|
+
const args = [
|
|
789
|
+
job.id,
|
|
790
|
+
(job.opts.lifo ? 'R' : 'L') + 'PUSH',
|
|
791
|
+
state === 'failed' ? 'failedReason' : 'returnvalue',
|
|
792
|
+
state,
|
|
793
|
+
];
|
|
794
|
+
const result = await this.execCommand(client, 'reprocessJob', keys.concat(args));
|
|
795
|
+
switch (result) {
|
|
796
|
+
case 1:
|
|
797
|
+
return;
|
|
798
|
+
default:
|
|
799
|
+
throw this.finishedErrors({
|
|
800
|
+
code: result,
|
|
801
|
+
jobId: job.id,
|
|
802
|
+
command: 'reprocessJob',
|
|
803
|
+
state,
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
async moveToActive(client, token, name) {
|
|
808
|
+
const opts = this.queue.opts;
|
|
809
|
+
const queueKeys = this.queue.keys;
|
|
810
|
+
const keys = [
|
|
811
|
+
queueKeys.wait,
|
|
812
|
+
queueKeys.active,
|
|
813
|
+
queueKeys.prioritized,
|
|
814
|
+
queueKeys.events,
|
|
815
|
+
queueKeys.stalled,
|
|
816
|
+
queueKeys.limiter,
|
|
817
|
+
queueKeys.delayed,
|
|
818
|
+
queueKeys.paused,
|
|
819
|
+
queueKeys.meta,
|
|
820
|
+
queueKeys.pc,
|
|
821
|
+
queueKeys.marker,
|
|
822
|
+
];
|
|
823
|
+
const args = [
|
|
824
|
+
queueKeys[''],
|
|
825
|
+
Date.now(),
|
|
826
|
+
pack({
|
|
827
|
+
token,
|
|
828
|
+
lockDuration: opts.lockDuration,
|
|
829
|
+
limiter: opts.limiter,
|
|
830
|
+
name,
|
|
831
|
+
}),
|
|
832
|
+
];
|
|
833
|
+
const result = await this.execCommand(client, 'moveToActive', keys.concat(args));
|
|
834
|
+
return raw2NextJobData(result);
|
|
835
|
+
}
|
|
836
|
+
async promote(jobId) {
|
|
837
|
+
const client = await this.queue.client;
|
|
838
|
+
const keys = [
|
|
839
|
+
this.queue.keys.delayed,
|
|
840
|
+
this.queue.keys.wait,
|
|
841
|
+
this.queue.keys.paused,
|
|
842
|
+
this.queue.keys.meta,
|
|
843
|
+
this.queue.keys.prioritized,
|
|
844
|
+
this.queue.keys.active,
|
|
845
|
+
this.queue.keys.pc,
|
|
846
|
+
this.queue.keys.events,
|
|
847
|
+
this.queue.keys.marker,
|
|
848
|
+
];
|
|
849
|
+
const args = [this.queue.toKey(''), jobId];
|
|
850
|
+
const code = await this.execCommand(client, 'promote', keys.concat(args));
|
|
851
|
+
if (code < 0) {
|
|
852
|
+
throw this.finishedErrors({
|
|
853
|
+
code,
|
|
854
|
+
jobId,
|
|
855
|
+
command: 'promote',
|
|
856
|
+
state: 'delayed',
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
moveStalledJobsToWaitArgs() {
|
|
861
|
+
const opts = this.queue.opts;
|
|
862
|
+
const keys = [
|
|
863
|
+
this.queue.keys.stalled,
|
|
864
|
+
this.queue.keys.wait,
|
|
865
|
+
this.queue.keys.active,
|
|
866
|
+
this.queue.keys.failed,
|
|
867
|
+
this.queue.keys['stalled-check'],
|
|
868
|
+
this.queue.keys.meta,
|
|
869
|
+
this.queue.keys.paused,
|
|
870
|
+
this.queue.keys.marker,
|
|
871
|
+
this.queue.keys.events,
|
|
872
|
+
];
|
|
873
|
+
const args = [
|
|
874
|
+
opts.maxStalledCount,
|
|
875
|
+
this.queue.toKey(''),
|
|
876
|
+
Date.now(),
|
|
877
|
+
opts.stalledInterval,
|
|
878
|
+
];
|
|
879
|
+
return keys.concat(args);
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Looks for unlocked jobs in the active queue.
|
|
883
|
+
*
|
|
884
|
+
* The job was being worked on, but the worker process died and it failed to renew the lock.
|
|
885
|
+
* We call these jobs 'stalled'. This is the most common case. We resolve these by moving them
|
|
886
|
+
* back to wait to be re-processed. To prevent jobs from cycling endlessly between active and wait,
|
|
887
|
+
* (e.g. if the job handler keeps crashing),
|
|
888
|
+
* we limit the number stalled job recoveries to settings.maxStalledCount.
|
|
889
|
+
*/
|
|
890
|
+
async moveStalledJobsToWait() {
|
|
891
|
+
const client = await this.queue.client;
|
|
892
|
+
const args = this.moveStalledJobsToWaitArgs();
|
|
893
|
+
return this.execCommand(client, 'moveStalledJobsToWait', args);
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Moves a job back from Active to Wait.
|
|
897
|
+
* This script is used when a job has been manually rate limited and needs
|
|
898
|
+
* to be moved back to wait from active status.
|
|
899
|
+
*
|
|
900
|
+
* @param client - Redis client
|
|
901
|
+
* @param jobId - Job id
|
|
902
|
+
* @returns
|
|
903
|
+
*/
|
|
904
|
+
async moveJobFromActiveToWait(jobId, token) {
|
|
905
|
+
const client = await this.queue.client;
|
|
906
|
+
const lockKey = `${this.queue.toKey(jobId)}:lock`;
|
|
907
|
+
const keys = [
|
|
908
|
+
this.queue.keys.active,
|
|
909
|
+
this.queue.keys.wait,
|
|
910
|
+
this.queue.keys.stalled,
|
|
911
|
+
lockKey,
|
|
912
|
+
this.queue.keys.paused,
|
|
913
|
+
this.queue.keys.meta,
|
|
914
|
+
this.queue.keys.limiter,
|
|
915
|
+
this.queue.keys.prioritized,
|
|
916
|
+
this.queue.keys.marker,
|
|
917
|
+
this.queue.keys.events,
|
|
918
|
+
];
|
|
919
|
+
const args = [jobId, token, this.queue.toKey(jobId)];
|
|
920
|
+
const pttl = await this.execCommand(client, 'moveJobFromActiveToWait', keys.concat(args));
|
|
921
|
+
return pttl < 0 ? 0 : pttl;
|
|
922
|
+
}
|
|
923
|
+
async obliterate(opts) {
|
|
924
|
+
const client = await this.queue.client;
|
|
925
|
+
const keys = [
|
|
926
|
+
this.queue.keys.meta,
|
|
927
|
+
this.queue.toKey(''),
|
|
928
|
+
];
|
|
929
|
+
const args = [opts.count, opts.force ? 'force' : null];
|
|
930
|
+
const result = await this.execCommand(client, 'obliterate', keys.concat(args));
|
|
931
|
+
if (result < 0) {
|
|
932
|
+
switch (result) {
|
|
933
|
+
case -1:
|
|
934
|
+
throw new Error('Cannot obliterate non-paused queue');
|
|
935
|
+
case -2:
|
|
936
|
+
throw new Error('Cannot obliterate queue with active jobs');
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
return result;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Paginate a set or hash keys.
|
|
943
|
+
* @param opts
|
|
944
|
+
*
|
|
945
|
+
*/
|
|
946
|
+
async paginate(key, opts) {
|
|
947
|
+
const client = await this.queue.client;
|
|
948
|
+
const keys = [key];
|
|
949
|
+
const maxIterations = 5;
|
|
950
|
+
const pageSize = opts.end >= 0 ? opts.end - opts.start + 1 : Infinity;
|
|
951
|
+
let cursor = '0', offset = 0, items, total, rawJobs, page = [], jobs = [];
|
|
952
|
+
do {
|
|
953
|
+
const args = [
|
|
954
|
+
opts.start + page.length,
|
|
955
|
+
opts.end,
|
|
956
|
+
cursor,
|
|
957
|
+
offset,
|
|
958
|
+
maxIterations,
|
|
959
|
+
];
|
|
960
|
+
if (opts.fetchJobs) {
|
|
961
|
+
args.push(1);
|
|
962
|
+
}
|
|
963
|
+
[cursor, offset, items, total, rawJobs] = await this.execCommand(client, 'paginate', keys.concat(args));
|
|
964
|
+
page = page.concat(items);
|
|
965
|
+
if (rawJobs && rawJobs.length) {
|
|
966
|
+
jobs = jobs.concat(rawJobs.map(array2obj));
|
|
967
|
+
}
|
|
968
|
+
// Important to keep this coercive inequality (!=) instead of strict inequality (!==)
|
|
969
|
+
} while (cursor != '0' && page.length < pageSize);
|
|
970
|
+
// If we get an array of arrays, it means we are paginating a hash
|
|
971
|
+
if (page.length && Array.isArray(page[0])) {
|
|
972
|
+
const result = [];
|
|
973
|
+
for (let index = 0; index < page.length; index++) {
|
|
974
|
+
const [id, value] = page[index];
|
|
975
|
+
try {
|
|
976
|
+
result.push({ id, v: JSON.parse(value) });
|
|
977
|
+
}
|
|
978
|
+
catch (err) {
|
|
979
|
+
result.push({ id, err: err.message });
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
return {
|
|
983
|
+
cursor,
|
|
984
|
+
items: result,
|
|
985
|
+
total,
|
|
986
|
+
jobs,
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
else {
|
|
990
|
+
return {
|
|
991
|
+
cursor,
|
|
992
|
+
items: page.map(item => ({ id: item })),
|
|
993
|
+
total,
|
|
994
|
+
jobs,
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
finishedErrors({ code, jobId, parentKey, command, state, }) {
|
|
999
|
+
switch (code) {
|
|
1000
|
+
case ErrorCode.JobNotExist:
|
|
1001
|
+
return new Error(`Missing key for job ${jobId}. ${command}`);
|
|
1002
|
+
case ErrorCode.JobLockNotExist:
|
|
1003
|
+
return new Error(`Missing lock for job ${jobId}. ${command}`);
|
|
1004
|
+
case ErrorCode.JobNotInState:
|
|
1005
|
+
return new Error(`Job ${jobId} is not in the ${state} state. ${command}`);
|
|
1006
|
+
case ErrorCode.JobPendingDependencies:
|
|
1007
|
+
return new Error(`Job ${jobId} has pending dependencies. ${command}`);
|
|
1008
|
+
case ErrorCode.ParentJobNotExist:
|
|
1009
|
+
return new Error(`Missing key for parent job ${parentKey}. ${command}`);
|
|
1010
|
+
case ErrorCode.JobLockMismatch:
|
|
1011
|
+
return new Error(`Lock mismatch for job ${jobId}. Cmd ${command} from ${state}`);
|
|
1012
|
+
case ErrorCode.ParentJobCannotBeReplaced:
|
|
1013
|
+
return new Error(`The parent job ${parentKey} cannot be replaced. ${command}`);
|
|
1014
|
+
case ErrorCode.JobBelongsToJobScheduler:
|
|
1015
|
+
return new Error(`Job ${jobId} belongs to a job scheduler and cannot be removed directly. ${command}`);
|
|
1016
|
+
default:
|
|
1017
|
+
return new Error(`Unknown code ${code} error for ${jobId}. ${command}`);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
export function raw2NextJobData(raw) {
|
|
1022
|
+
if (raw) {
|
|
1023
|
+
const result = [null, raw[1], raw[2], raw[3]];
|
|
1024
|
+
if (raw[0]) {
|
|
1025
|
+
result[0] = array2obj(raw[0]);
|
|
1026
|
+
}
|
|
1027
|
+
return result;
|
|
1028
|
+
}
|
|
1029
|
+
return [];
|
|
1030
|
+
}
|
|
1031
|
+
//# sourceMappingURL=scripts.js.map
|