@tachybase/plugin-adapter-bullmq 1.3.16 → 1.3.18
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/dist/externalVersion.js +2 -2
- package/dist/index.js +4 -4
- package/dist/node_modules/@bull-board/api/dist/src/handlers/error.d.ts +4 -2
- package/dist/node_modules/@bull-board/api/dist/src/handlers/error.js +2 -2
- package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseAll.d.ts +4 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseAll.js +15 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/queues.js +4 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeAll.d.ts +4 -0
- package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeAll.js +15 -0
- package/dist/node_modules/@bull-board/api/dist/src/index.js +1 -1
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.d.ts +4 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.js +6 -0
- package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/bull.js +6 -4
- package/dist/node_modules/@bull-board/api/dist/src/routes.js +4 -0
- package/dist/node_modules/@bull-board/api/dist/typings/app.d.ts +22 -2
- package/dist/node_modules/@bull-board/api/package.json +1 -1
- package/dist/node_modules/@bull-board/koa/dist/KoaAdapter.js +1 -1
- package/dist/node_modules/@bull-board/koa/dist/index.js +101 -101
- package/dist/node_modules/@bull-board/koa/package.json +1 -1
- package/dist/node_modules/bullmq/dist/cjs/classes/backoffs.js +18 -5
- package/dist/node_modules/bullmq/dist/cjs/classes/child-pool.js +7 -2
- package/dist/node_modules/bullmq/dist/cjs/classes/child-processor.js +59 -5
- package/dist/node_modules/bullmq/dist/cjs/classes/child.js +3 -1
- package/dist/node_modules/bullmq/dist/cjs/classes/errors/index.js +2 -1
- package/dist/node_modules/bullmq/dist/cjs/classes/errors/waiting-error.js +19 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/flow-producer.js +21 -5
- package/dist/node_modules/bullmq/dist/cjs/classes/index.js +1 -0
- package/dist/node_modules/bullmq/dist/cjs/classes/job-scheduler.js +88 -62
- package/dist/node_modules/bullmq/dist/cjs/classes/job.js +216 -109
- package/dist/node_modules/bullmq/dist/cjs/classes/main-base.js +1 -1
- package/dist/node_modules/bullmq/dist/cjs/classes/queue-base.js +10 -9
- package/dist/node_modules/bullmq/dist/cjs/classes/queue-getters.js +34 -14
- package/dist/node_modules/bullmq/dist/cjs/classes/queue.js +19 -13
- package/dist/node_modules/bullmq/dist/cjs/classes/redis-connection.js +16 -9
- package/dist/node_modules/bullmq/dist/cjs/classes/repeat.js +1 -1
- package/dist/node_modules/bullmq/dist/cjs/classes/sandbox.js +54 -28
- package/dist/node_modules/bullmq/dist/cjs/classes/scripts.js +141 -39
- package/dist/node_modules/bullmq/dist/cjs/classes/worker.js +191 -182
- package/dist/node_modules/bullmq/dist/cjs/commands/addDelayedJob-6.lua +6 -17
- package/dist/node_modules/bullmq/dist/cjs/commands/addJobScheduler-11.lua +123 -0
- package/dist/node_modules/bullmq/dist/{esm/commands/addParentJob-4.lua → cjs/commands/addParentJob-5.lua} +7 -6
- package/dist/node_modules/bullmq/dist/cjs/commands/{addPrioritizedJob-8.lua → addPrioritizedJob-9.lua} +11 -10
- package/dist/node_modules/bullmq/dist/cjs/commands/addRepeatableJob-2.lua +2 -2
- package/dist/node_modules/bullmq/dist/{esm/commands/addStandardJob-8.lua → cjs/commands/addStandardJob-9.lua} +9 -8
- package/dist/node_modules/bullmq/dist/cjs/commands/cleanJobsInSet-3.lua +9 -5
- package/dist/node_modules/bullmq/dist/cjs/commands/drain-5.lua +16 -16
- package/dist/node_modules/bullmq/dist/cjs/commands/getDependencyCounts-4.lua +31 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/getState-8.lua +5 -5
- package/dist/node_modules/bullmq/dist/cjs/commands/getStateV2-8.lua +8 -8
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/addDelayedJob.lua +23 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobFromScheduler.lua +37 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobWithPriority.lua +2 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanList.lua +4 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanSet.lua +3 -11
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/collectMetrics.lua +1 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/deduplicateJob.lua +63 -18
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/filterOutJobsToIgnore.lua +14 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getNextDelayedTimestamp.lua +1 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getOrSetMaxEvents.lua +6 -6
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/getPriorityScore.lua +8 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/isJobSchedulerJob.lua +15 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/isLocked.lua +1 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveChildFromDependenciesIfNeeded.lua +77 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWait.lua +45 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWaitIfNeeded.lua +9 -50
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWaitIfNoPendingDependencies.lua +13 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/prepareJobForProcessing.lua +2 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/promoteDelayedJobs.lua +7 -3
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeededOnFinalization.lua +23 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeededOnRemoval.lua +16 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJob.lua +2 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobKeys.lua +2 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobWithChildren.lua +95 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeListJobs.lua +7 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeParentDependencyKey.lua +5 -5
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeZSetJobs.lua +2 -8
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/storeJob.lua +2 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/storeJobScheduler.lua +52 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/trimEvents.lua +1 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateExistingJobsParent.lua +1 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateJobFields.lua +5 -5
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateParentDepsIfNeeded.lua +2 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/isFinished-3.lua +2 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/moveJobFromActiveToWait-9.lua +63 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveStalledJobsToWait-8.lua +109 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToActive-11.lua +3 -2
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToFinished-14.lua +52 -52
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToWaitingChildren-8.lua +106 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/removeJob-2.lua +18 -66
- package/dist/node_modules/bullmq/dist/cjs/commands/removeJobScheduler-3.lua +1 -1
- package/dist/node_modules/bullmq/dist/cjs/commands/removeUnprocessedChildren-2.lua +31 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/retryJob-11.lua +11 -5
- package/dist/node_modules/bullmq/dist/cjs/commands/updateJobScheduler-12.lua +90 -0
- package/dist/node_modules/bullmq/dist/cjs/commands/updateRepeatableJobMillis-1.lua +1 -1
- package/dist/node_modules/bullmq/dist/cjs/enums/child-command.js +2 -0
- package/dist/node_modules/bullmq/dist/cjs/enums/error-code.js +2 -1
- package/dist/node_modules/bullmq/dist/cjs/enums/parent-command.js +5 -2
- package/dist/node_modules/bullmq/dist/cjs/index.js +1 -1
- package/dist/node_modules/bullmq/dist/cjs/interfaces/index.js +2 -1
- package/dist/node_modules/bullmq/dist/cjs/interfaces/{debounce-options.js → parent-options.js} +1 -1
- package/dist/node_modules/bullmq/dist/cjs/interfaces/receiver.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/addDelayedJob-6.js +163 -84
- package/dist/node_modules/bullmq/dist/cjs/scripts/addJobScheduler-11.js +465 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/{addParentJob-4.js → addParentJob-5.js} +147 -75
- package/dist/node_modules/bullmq/dist/cjs/scripts/{addPrioritizedJob-8.js → addPrioritizedJob-9.js} +151 -79
- package/dist/node_modules/bullmq/dist/cjs/scripts/addRepeatableJob-2.js +18 -13
- package/dist/node_modules/bullmq/dist/cjs/scripts/{addStandardJob-8.js → addStandardJob-9.js} +149 -77
- package/dist/node_modules/bullmq/dist/cjs/scripts/changeDelay-4.js +7 -7
- package/dist/node_modules/bullmq/dist/cjs/scripts/changePriority-7.js +8 -2
- package/dist/node_modules/bullmq/dist/cjs/scripts/cleanJobsInSet-3.js +45 -29
- package/dist/node_modules/bullmq/dist/cjs/scripts/drain-5.js +49 -35
- package/dist/node_modules/bullmq/dist/cjs/scripts/getDependencyCounts-4.js +37 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/getState-8.js +5 -5
- package/dist/node_modules/bullmq/dist/cjs/scripts/getStateV2-8.js +8 -8
- package/dist/node_modules/bullmq/dist/cjs/scripts/index.js +10 -7
- package/dist/node_modules/bullmq/dist/cjs/scripts/isFinished-3.js +2 -2
- package/dist/node_modules/bullmq/dist/cjs/scripts/{moveJobFromActiveToWait-10.js → moveJobFromActiveToWait-9.js} +57 -37
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveJobsToWait-8.js +6 -6
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveStalledJobsToWait-8.js +171 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToActive-11.js +18 -8
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToDelayed-8.js +12 -12
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToFinished-14.js +218 -155
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToWaitingChildren-8.js +529 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/obliterate-2.js +33 -20
- package/dist/node_modules/bullmq/dist/cjs/scripts/pause-7.js +1 -1
- package/dist/node_modules/bullmq/dist/cjs/scripts/promote-9.js +8 -2
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeChildDependency-1.js +7 -7
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeJob-2.js +120 -63
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeJobScheduler-3.js +3 -3
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeRepeatable-3.js +2 -2
- package/dist/node_modules/bullmq/dist/cjs/scripts/removeUnprocessedChildren-2.js +339 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/reprocessJob-8.js +6 -6
- package/dist/node_modules/bullmq/dist/cjs/scripts/retryJob-11.js +47 -26
- package/dist/node_modules/bullmq/dist/cjs/scripts/updateJobScheduler-12.js +274 -0
- package/dist/node_modules/bullmq/dist/cjs/scripts/updateProgress-3.js +6 -6
- package/dist/node_modules/bullmq/dist/cjs/scripts/updateRepeatableJobMillis-1.js +1 -1
- package/dist/node_modules/bullmq/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/node_modules/bullmq/dist/cjs/types/deduplication-options.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/index.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/job-progress.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/types/script-queue-context.js +3 -0
- package/dist/node_modules/bullmq/dist/cjs/utils.js +29 -1
- package/dist/node_modules/bullmq/dist/cjs/version.js +1 -1
- package/dist/node_modules/bullmq/dist/esm/classes/backoffs.d.ts +1 -1
- package/dist/node_modules/bullmq/dist/esm/classes/backoffs.js +18 -5
- package/dist/node_modules/bullmq/dist/esm/classes/child-pool.d.ts +1 -1
- package/dist/node_modules/bullmq/dist/esm/classes/child-pool.js +7 -2
- package/dist/node_modules/bullmq/dist/esm/classes/child-processor.d.ts +3 -2
- package/dist/node_modules/bullmq/dist/esm/classes/child-processor.js +59 -5
- package/dist/node_modules/bullmq/dist/esm/classes/child.js +3 -1
- package/dist/node_modules/bullmq/dist/esm/classes/errors/index.d.ts +2 -1
- package/dist/node_modules/bullmq/dist/esm/classes/errors/index.js +2 -1
- package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-error.d.ts +10 -0
- package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-error.js +15 -0
- package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.d.ts +3 -9
- package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.js +21 -5
- package/dist/node_modules/bullmq/dist/esm/classes/index.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/esm/classes/index.js +1 -0
- package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.d.ts +2 -2
- package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.js +88 -62
- package/dist/node_modules/bullmq/dist/esm/classes/job.d.ts +69 -19
- package/dist/node_modules/bullmq/dist/esm/classes/job.js +217 -110
- package/dist/node_modules/bullmq/dist/esm/classes/main-base.d.ts +2 -3
- package/dist/node_modules/bullmq/dist/esm/classes/main-base.js +1 -1
- package/dist/node_modules/bullmq/dist/esm/classes/queue-base.d.ts +2 -5
- package/dist/node_modules/bullmq/dist/esm/classes/queue-base.js +11 -10
- package/dist/node_modules/bullmq/dist/esm/classes/queue-events-producer.d.ts +2 -2
- package/dist/node_modules/bullmq/dist/esm/classes/queue-events.d.ts +118 -29
- package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.d.ts +20 -13
- package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.js +34 -14
- package/dist/node_modules/bullmq/dist/esm/classes/queue.d.ts +19 -16
- package/dist/node_modules/bullmq/dist/esm/classes/queue.js +19 -13
- package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.d.ts +7 -3
- package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.js +16 -9
- package/dist/node_modules/bullmq/dist/esm/classes/repeat.js +1 -1
- package/dist/node_modules/bullmq/dist/esm/classes/sandbox.js +54 -28
- package/dist/node_modules/bullmq/dist/esm/classes/scripts.d.ts +20 -13
- package/dist/node_modules/bullmq/dist/esm/classes/scripts.js +141 -39
- package/dist/node_modules/bullmq/dist/esm/classes/worker.d.ts +28 -7
- package/dist/node_modules/bullmq/dist/esm/classes/worker.js +192 -183
- package/dist/node_modules/bullmq/dist/esm/commands/addDelayedJob-6.lua +6 -17
- package/dist/node_modules/bullmq/dist/esm/commands/addJobScheduler-11.lua +123 -0
- package/dist/node_modules/bullmq/dist/{cjs/commands/addParentJob-4.lua → esm/commands/addParentJob-5.lua} +7 -6
- package/dist/node_modules/bullmq/dist/esm/commands/{addPrioritizedJob-8.lua → addPrioritizedJob-9.lua} +11 -10
- package/dist/node_modules/bullmq/dist/esm/commands/addRepeatableJob-2.lua +2 -2
- package/dist/node_modules/bullmq/dist/{cjs/commands/addStandardJob-8.lua → esm/commands/addStandardJob-9.lua} +9 -8
- package/dist/node_modules/bullmq/dist/esm/commands/cleanJobsInSet-3.lua +9 -5
- package/dist/node_modules/bullmq/dist/esm/commands/drain-5.lua +16 -16
- package/dist/node_modules/bullmq/dist/esm/commands/getDependencyCounts-4.lua +31 -0
- package/dist/node_modules/bullmq/dist/esm/commands/getState-8.lua +5 -5
- package/dist/node_modules/bullmq/dist/esm/commands/getStateV2-8.lua +8 -8
- package/dist/node_modules/bullmq/dist/esm/commands/includes/addDelayedJob.lua +23 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobFromScheduler.lua +37 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobWithPriority.lua +2 -2
- package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanList.lua +4 -2
- package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanSet.lua +3 -11
- package/dist/node_modules/bullmq/dist/esm/commands/includes/collectMetrics.lua +1 -1
- package/dist/node_modules/bullmq/dist/esm/commands/includes/deduplicateJob.lua +63 -18
- package/dist/node_modules/bullmq/dist/esm/commands/includes/filterOutJobsToIgnore.lua +14 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getNextDelayedTimestamp.lua +1 -1
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getOrSetMaxEvents.lua +6 -6
- package/dist/node_modules/bullmq/dist/esm/commands/includes/getPriorityScore.lua +8 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/isJobSchedulerJob.lua +15 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/isLocked.lua +1 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveChildFromDependenciesIfNeeded.lua +77 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWait.lua +45 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWaitIfNeeded.lua +9 -50
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWaitIfNoPendingDependencies.lua +13 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/prepareJobForProcessing.lua +2 -1
- package/dist/node_modules/bullmq/dist/esm/commands/includes/promoteDelayedJobs.lua +7 -3
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeededOnFinalization.lua +23 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeededOnRemoval.lua +16 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJob.lua +2 -2
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobKeys.lua +2 -2
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobWithChildren.lua +95 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeListJobs.lua +7 -1
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeParentDependencyKey.lua +5 -5
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeZSetJobs.lua +2 -8
- package/dist/node_modules/bullmq/dist/esm/commands/includes/storeJob.lua +2 -2
- package/dist/node_modules/bullmq/dist/esm/commands/includes/storeJobScheduler.lua +52 -0
- package/dist/node_modules/bullmq/dist/esm/commands/includes/trimEvents.lua +1 -1
- package/dist/node_modules/bullmq/dist/esm/commands/includes/updateExistingJobsParent.lua +1 -1
- package/dist/node_modules/bullmq/dist/esm/commands/includes/updateJobFields.lua +5 -5
- package/dist/node_modules/bullmq/dist/esm/commands/includes/updateParentDepsIfNeeded.lua +2 -2
- package/dist/node_modules/bullmq/dist/esm/commands/isFinished-3.lua +2 -2
- package/dist/node_modules/bullmq/dist/esm/commands/moveJobFromActiveToWait-9.lua +63 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveStalledJobsToWait-8.lua +109 -0
- package/dist/node_modules/bullmq/dist/esm/commands/moveToActive-11.lua +3 -2
- package/dist/node_modules/bullmq/dist/esm/commands/moveToFinished-14.lua +52 -52
- package/dist/node_modules/bullmq/dist/esm/commands/moveToWaitingChildren-8.lua +106 -0
- package/dist/node_modules/bullmq/dist/esm/commands/removeJob-2.lua +18 -66
- package/dist/node_modules/bullmq/dist/esm/commands/removeJobScheduler-3.lua +1 -1
- package/dist/node_modules/bullmq/dist/esm/commands/removeUnprocessedChildren-2.lua +31 -0
- package/dist/node_modules/bullmq/dist/esm/commands/retryJob-11.lua +11 -5
- package/dist/node_modules/bullmq/dist/esm/commands/updateJobScheduler-12.lua +90 -0
- package/dist/node_modules/bullmq/dist/esm/commands/updateRepeatableJobMillis-1.lua +1 -1
- package/dist/node_modules/bullmq/dist/esm/enums/child-command.d.ts +3 -1
- package/dist/node_modules/bullmq/dist/esm/enums/child-command.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/enums/error-code.d.ts +3 -2
- package/dist/node_modules/bullmq/dist/esm/enums/error-code.js +2 -1
- package/dist/node_modules/bullmq/dist/esm/enums/parent-command.d.ts +5 -2
- package/dist/node_modules/bullmq/dist/esm/enums/parent-command.js +5 -2
- package/dist/node_modules/bullmq/dist/esm/interfaces/backoff-options.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts +3 -9
- package/dist/node_modules/bullmq/dist/esm/interfaces/child-message.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/index.d.ts +2 -1
- package/dist/node_modules/bullmq/dist/esm/interfaces/index.js +2 -1
- package/dist/node_modules/bullmq/dist/esm/interfaces/job-json.d.ts +6 -2
- package/dist/node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.d.ts +7 -4
- package/dist/node_modules/bullmq/dist/esm/interfaces/minimal-job.d.ts +34 -15
- package/dist/node_modules/bullmq/dist/esm/interfaces/parent-options.d.ts +11 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/parent-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/parent.d.ts +6 -2
- package/dist/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts +15 -6
- package/dist/node_modules/bullmq/dist/esm/interfaces/receiver.d.ts +4 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/receiver.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeat-options.d.ts +1 -2
- package/dist/node_modules/bullmq/dist/esm/interfaces/repeatable-options.d.ts +2 -0
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-job.d.ts +3 -2
- package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-options.d.ts +1 -1
- package/dist/node_modules/bullmq/dist/esm/interfaces/telemetry.d.ts +18 -15
- package/dist/node_modules/bullmq/dist/esm/interfaces/worker-options.d.ts +10 -10
- package/dist/node_modules/bullmq/dist/esm/scripts/addDelayedJob-6.js +163 -84
- package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-11.js +462 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/{addParentJob-4.js → addParentJob-5.js} +147 -75
- package/dist/node_modules/bullmq/dist/esm/scripts/{addPrioritizedJob-8.js → addPrioritizedJob-9.js} +151 -79
- package/dist/node_modules/bullmq/dist/esm/scripts/addRepeatableJob-2.js +18 -13
- package/dist/node_modules/bullmq/dist/esm/scripts/{addStandardJob-8.js → addStandardJob-9.js} +149 -77
- package/dist/node_modules/bullmq/dist/esm/scripts/changeDelay-4.js +7 -7
- package/dist/node_modules/bullmq/dist/esm/scripts/changePriority-7.js +8 -2
- package/dist/node_modules/bullmq/dist/esm/scripts/cleanJobsInSet-3.js +45 -29
- package/dist/node_modules/bullmq/dist/esm/scripts/drain-5.js +49 -35
- package/dist/node_modules/bullmq/dist/esm/scripts/getDependencyCounts-4.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getDependencyCounts-4.js +34 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/getState-8.js +5 -5
- package/dist/node_modules/bullmq/dist/esm/scripts/getStateV2-8.js +8 -8
- package/dist/node_modules/bullmq/dist/esm/scripts/index.d.ts +10 -7
- package/dist/node_modules/bullmq/dist/esm/scripts/index.js +10 -7
- package/dist/node_modules/bullmq/dist/esm/scripts/isFinished-3.js +2 -2
- package/dist/node_modules/bullmq/dist/esm/scripts/{moveJobFromActiveToWait-10.js → moveJobFromActiveToWait-9.js} +57 -37
- package/dist/node_modules/bullmq/dist/esm/scripts/moveJobsToWait-8.js +6 -6
- package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-8.js +168 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToActive-11.js +18 -8
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToDelayed-8.js +12 -12
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToFinished-14.js +218 -155
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-8.js +526 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/obliterate-2.js +33 -20
- package/dist/node_modules/bullmq/dist/esm/scripts/pause-7.js +1 -1
- package/dist/node_modules/bullmq/dist/esm/scripts/promote-9.js +8 -2
- package/dist/node_modules/bullmq/dist/esm/scripts/removeChildDependency-1.js +7 -7
- package/dist/node_modules/bullmq/dist/esm/scripts/removeJob-2.js +120 -63
- package/dist/node_modules/bullmq/dist/esm/scripts/removeJobScheduler-3.js +3 -3
- package/dist/node_modules/bullmq/dist/esm/scripts/removeRepeatable-3.js +2 -2
- package/dist/node_modules/bullmq/dist/esm/scripts/removeUnprocessedChildren-2.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/removeUnprocessedChildren-2.js +336 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/reprocessJob-8.js +6 -6
- package/dist/node_modules/bullmq/dist/esm/scripts/retryJob-11.js +47 -26
- package/dist/node_modules/bullmq/dist/esm/scripts/updateJobScheduler-12.d.ts +5 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateJobScheduler-12.js +271 -0
- package/dist/node_modules/bullmq/dist/esm/scripts/updateProgress-3.js +6 -6
- package/dist/node_modules/bullmq/dist/esm/scripts/updateRepeatableJobMillis-1.js +1 -1
- package/dist/node_modules/bullmq/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/bullmq/dist/esm/types/deduplication-options.d.ts +22 -0
- package/dist/node_modules/bullmq/dist/esm/types/deduplication-options.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/index.d.ts +3 -0
- package/dist/node_modules/bullmq/dist/esm/types/index.js +3 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-options.d.ts +19 -8
- package/dist/node_modules/bullmq/dist/esm/types/job-progress.d.ts +1 -0
- package/dist/node_modules/bullmq/dist/esm/types/job-progress.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/script-queue-context.d.ts +2 -0
- package/dist/node_modules/bullmq/dist/esm/types/script-queue-context.js +2 -0
- package/dist/node_modules/bullmq/dist/esm/utils.d.ts +25 -5
- package/dist/node_modules/bullmq/dist/esm/utils.js +27 -0
- package/dist/node_modules/bullmq/dist/esm/version.d.ts +1 -1
- package/dist/node_modules/bullmq/dist/esm/version.js +1 -1
- package/dist/node_modules/bullmq/package.json +1 -1
- package/package.json +7 -7
- package/dist/node_modules/bullmq/dist/cjs/commands/addJobScheduler-2.lua +0 -91
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentFromWaitingChildrenToFailed.lua +0 -53
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKey.lua +0 -11
- package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeeded.lua +0 -14
- package/dist/node_modules/bullmq/dist/cjs/commands/moveJobFromActiveToWait-10.lua +0 -60
- package/dist/node_modules/bullmq/dist/cjs/commands/moveStalledJobsToWait-9.lua +0 -156
- package/dist/node_modules/bullmq/dist/cjs/commands/moveToWaitingChildren-5.lua +0 -68
- package/dist/node_modules/bullmq/dist/cjs/scripts/addJobScheduler-2.js +0 -237
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveStalledJobsToWait-9.js +0 -529
- package/dist/node_modules/bullmq/dist/cjs/scripts/moveToWaitingChildren-5.js +0 -83
- package/dist/node_modules/bullmq/dist/esm/commands/addJobScheduler-2.lua +0 -91
- package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentFromWaitingChildrenToFailed.lua +0 -53
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKey.lua +0 -11
- package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeeded.lua +0 -14
- package/dist/node_modules/bullmq/dist/esm/commands/moveJobFromActiveToWait-10.lua +0 -60
- package/dist/node_modules/bullmq/dist/esm/commands/moveStalledJobsToWait-9.lua +0 -156
- package/dist/node_modules/bullmq/dist/esm/commands/moveToWaitingChildren-5.lua +0 -68
- package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.d.ts +0 -13
- package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.js +0 -2
- package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-2.js +0 -234
- package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-9.js +0 -526
- package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-5.js +0 -80
- /package/dist/node_modules/bullmq/dist/esm/scripts/{addJobScheduler-2.d.ts → addJobScheduler-11.d.ts} +0 -0
- /package/dist/node_modules/bullmq/dist/esm/scripts/{addParentJob-4.d.ts → addParentJob-5.d.ts} +0 -0
- /package/dist/node_modules/bullmq/dist/esm/scripts/{addPrioritizedJob-8.d.ts → addPrioritizedJob-9.d.ts} +0 -0
- /package/dist/node_modules/bullmq/dist/esm/scripts/{addStandardJob-8.d.ts → addStandardJob-9.d.ts} +0 -0
- /package/dist/node_modules/bullmq/dist/esm/scripts/{moveJobFromActiveToWait-10.d.ts → moveJobFromActiveToWait-9.d.ts} +0 -0
- /package/dist/node_modules/bullmq/dist/esm/scripts/{moveStalledJobsToWait-9.d.ts → moveStalledJobsToWait-8.d.ts} +0 -0
- /package/dist/node_modules/bullmq/dist/esm/scripts/{moveToWaitingChildren-5.d.ts → moveToWaitingChildren-8.d.ts} +0 -0
|
@@ -32,21 +32,26 @@ local prefixKey = ARGV[5]
|
|
|
32
32
|
]]
|
|
33
33
|
-- Includes
|
|
34
34
|
--[[
|
|
35
|
-
Function to remove deduplication key
|
|
35
|
+
Function to remove deduplication key if needed
|
|
36
|
+
when a job is being removed.
|
|
36
37
|
]]
|
|
37
|
-
local function
|
|
38
|
+
local function removeDeduplicationKeyIfNeededOnRemoval(prefixKey,
|
|
39
|
+
jobKey, jobId)
|
|
38
40
|
local deduplicationId = rcall("HGET", jobKey, "deid")
|
|
39
41
|
if deduplicationId then
|
|
40
42
|
local deduplicationKey = prefixKey .. "de:" .. deduplicationId
|
|
41
|
-
rcall(
|
|
43
|
+
local currentJobId = rcall('GET', deduplicationKey)
|
|
44
|
+
if currentJobId and currentJobId == jobId then
|
|
45
|
+
return rcall("DEL", deduplicationKey)
|
|
46
|
+
end
|
|
42
47
|
end
|
|
43
48
|
end
|
|
44
49
|
--[[
|
|
45
50
|
Function to remove job keys.
|
|
46
51
|
]]
|
|
47
52
|
local function removeJobKeys(jobKey)
|
|
48
|
-
return rcall("DEL", jobKey, jobKey .. ':logs',
|
|
49
|
-
jobKey .. ':
|
|
53
|
+
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
54
|
+
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
50
55
|
end
|
|
51
56
|
--[[
|
|
52
57
|
Check if this job has a parent. If so we will just remove it from
|
|
@@ -100,7 +105,7 @@ local function getTargetQueueList(queueMetaKey, activeKey, waitKey, pausedKey)
|
|
|
100
105
|
end
|
|
101
106
|
return waitKey, false
|
|
102
107
|
end
|
|
103
|
-
local function
|
|
108
|
+
local function _moveParentToWait(parentPrefix, parentId, emitEvent)
|
|
104
109
|
local parentTarget, isPausedOrMaxed = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "active",
|
|
105
110
|
parentPrefix .. "wait", parentPrefix .. "paused")
|
|
106
111
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPausedOrMaxed, parentId)
|
|
@@ -128,10 +133,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey, debou
|
|
|
128
133
|
rcall("DEL", parentPrefix .. "de:" .. debounceId)
|
|
129
134
|
end
|
|
130
135
|
else
|
|
131
|
-
|
|
136
|
+
_moveParentToWait(parentPrefix, parentId)
|
|
132
137
|
end
|
|
133
138
|
else
|
|
134
|
-
|
|
139
|
+
_moveParentToWait(parentPrefix, parentId, true)
|
|
135
140
|
end
|
|
136
141
|
end
|
|
137
142
|
end
|
|
@@ -159,10 +164,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey, debou
|
|
|
159
164
|
rcall("DEL", parentPrefix .. "de:" .. parentAttributes[2])
|
|
160
165
|
end
|
|
161
166
|
else
|
|
162
|
-
|
|
167
|
+
_moveParentToWait(parentPrefix, parentId)
|
|
163
168
|
end
|
|
164
169
|
else
|
|
165
|
-
|
|
170
|
+
_moveParentToWait(parentPrefix, parentId, true)
|
|
166
171
|
end
|
|
167
172
|
end
|
|
168
173
|
end
|
|
@@ -176,7 +181,7 @@ local function removeJob(jobId, hard, baseKey, shouldRemoveDeduplicationKey)
|
|
|
176
181
|
local jobKey = baseKey .. jobId
|
|
177
182
|
removeParentDependencyKey(jobKey, hard, nil, baseKey)
|
|
178
183
|
if shouldRemoveDeduplicationKey then
|
|
179
|
-
|
|
184
|
+
removeDeduplicationKeyIfNeededOnRemoval(baseKey, jobKey, jobId)
|
|
180
185
|
end
|
|
181
186
|
removeJobKeys(jobKey)
|
|
182
187
|
end
|
|
@@ -207,10 +212,10 @@ end
|
|
|
207
212
|
-- If we are overriding a repeatable job we must delete the delayed job for
|
|
208
213
|
-- the next iteration.
|
|
209
214
|
local prevMillis = rcall("ZSCORE", repeatKey, customKey)
|
|
210
|
-
if prevMillis
|
|
215
|
+
if prevMillis then
|
|
211
216
|
local delayedJobId = "repeat:" .. customKey .. ":" .. prevMillis
|
|
212
217
|
local nextDelayedJobId = repeatKey .. ":" .. customKey .. ":" .. nextMillis
|
|
213
|
-
if rcall("ZSCORE", delayedKey, delayedJobId)
|
|
218
|
+
if rcall("ZSCORE", delayedKey, delayedJobId)
|
|
214
219
|
and rcall("EXISTS", nextDelayedJobId) ~= 1 then
|
|
215
220
|
removeJob(delayedJobId, true, prefixKey, true --[[remove debounce key]])
|
|
216
221
|
rcall("ZREM", delayedKey, delayedJobId)
|
package/dist/node_modules/bullmq/dist/cjs/scripts/{addStandardJob-8.js → addStandardJob-9.js}
RENAMED
|
@@ -21,9 +21,10 @@ const content = `--[[
|
|
|
21
21
|
KEYS[3] 'meta'
|
|
22
22
|
KEYS[4] 'id'
|
|
23
23
|
KEYS[5] 'completed'
|
|
24
|
-
KEYS[6] '
|
|
25
|
-
KEYS[7]
|
|
26
|
-
KEYS[8]
|
|
24
|
+
KEYS[6] 'delayed'
|
|
25
|
+
KEYS[7] 'active'
|
|
26
|
+
KEYS[8] events stream key
|
|
27
|
+
KEYS[9] marker key
|
|
27
28
|
ARGV[1] msgpacked arguments array
|
|
28
29
|
[1] key prefix,
|
|
29
30
|
[2] custom id (will not generate one automatically)
|
|
@@ -41,7 +42,7 @@ const content = `--[[
|
|
|
41
42
|
jobId - OK
|
|
42
43
|
-5 - Missing parent key
|
|
43
44
|
]]
|
|
44
|
-
local eventsKey = KEYS[
|
|
45
|
+
local eventsKey = KEYS[8]
|
|
45
46
|
local jobId
|
|
46
47
|
local jobIdKey
|
|
47
48
|
local rcall = redis.call
|
|
@@ -73,36 +74,85 @@ end
|
|
|
73
74
|
--[[
|
|
74
75
|
Function to debounce a job.
|
|
75
76
|
]]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
-- Includes
|
|
78
|
+
--[[
|
|
79
|
+
Function to remove job keys.
|
|
80
|
+
]]
|
|
81
|
+
local function removeJobKeys(jobKey)
|
|
82
|
+
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
83
|
+
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
84
|
+
end
|
|
85
|
+
local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
86
|
+
prefix)
|
|
87
|
+
local deduplicationId = deduplicationOpts and deduplicationOpts['id']
|
|
88
|
+
if deduplicationId then
|
|
89
|
+
local ttl = deduplicationOpts['ttl']
|
|
90
|
+
if deduplicationOpts['replace'] and ttl and ttl > 0 then
|
|
91
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
92
|
+
if currentDebounceJobId then
|
|
93
|
+
if rcall("ZREM", delayedKey, currentDebounceJobId) > 0 then
|
|
94
|
+
removeJobKeys(prefix .. currentDebounceJobId)
|
|
95
|
+
rcall("XADD", eventsKey, "*", "event", "removed", "jobId", currentDebounceJobId,
|
|
96
|
+
"prev", "delayed")
|
|
97
|
+
if deduplicationOpts['extend'] then
|
|
98
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
99
|
+
else
|
|
100
|
+
rcall('SET', deduplicationKey, jobId, 'KEEPTTL')
|
|
101
|
+
end
|
|
102
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
103
|
+
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDebounceJobId)
|
|
104
|
+
return
|
|
105
|
+
else
|
|
106
|
+
return currentDebounceJobId
|
|
107
|
+
end
|
|
108
|
+
else
|
|
109
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
110
|
+
return
|
|
111
|
+
end
|
|
112
|
+
else
|
|
113
|
+
local ttl = deduplicationOpts['ttl']
|
|
114
|
+
local deduplicationKeyExists
|
|
115
|
+
if ttl then
|
|
116
|
+
if deduplicationOpts['extend'] then
|
|
117
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
118
|
+
if currentDebounceJobId then
|
|
119
|
+
rcall('SET', deduplicationKey, currentDebounceJobId, 'PX', ttl)
|
|
120
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced",
|
|
121
|
+
"jobId", currentDebounceJobId, "debounceId", deduplicationId)
|
|
122
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
123
|
+
currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
|
|
124
|
+
return currentDebounceJobId
|
|
125
|
+
else
|
|
126
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
127
|
+
return
|
|
128
|
+
end
|
|
129
|
+
else
|
|
130
|
+
deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
|
|
131
|
+
end
|
|
132
|
+
else
|
|
133
|
+
deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
|
|
134
|
+
end
|
|
135
|
+
if deduplicationKeyExists then
|
|
136
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
137
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
138
|
+
currentDebounceJobId, "debounceId", deduplicationId)
|
|
139
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
140
|
+
currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
|
|
141
|
+
return currentDebounceJobId
|
|
142
|
+
end
|
|
143
|
+
end
|
|
93
144
|
end
|
|
94
|
-
end
|
|
95
145
|
end
|
|
96
146
|
--[[
|
|
97
147
|
Function to get max events value or set by default 10000.
|
|
98
148
|
]]
|
|
99
149
|
local function getOrSetMaxEvents(metaKey)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
150
|
+
local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
|
|
151
|
+
if not maxEvents then
|
|
152
|
+
maxEvents = 10000
|
|
153
|
+
rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
|
|
154
|
+
end
|
|
155
|
+
return maxEvents
|
|
106
156
|
end
|
|
107
157
|
--[[
|
|
108
158
|
Function to check for the meta.paused key to decide if we are paused or not
|
|
@@ -140,7 +190,16 @@ end
|
|
|
140
190
|
]]
|
|
141
191
|
-- Includes
|
|
142
192
|
--[[
|
|
143
|
-
Validate and move parent to
|
|
193
|
+
Validate and move parent to a wait status (waiting, delayed or prioritized)
|
|
194
|
+
if no pending dependencies.
|
|
195
|
+
]]
|
|
196
|
+
-- Includes
|
|
197
|
+
--[[
|
|
198
|
+
Validate and move parent to a wait status (waiting, delayed or prioritized) if needed.
|
|
199
|
+
]]
|
|
200
|
+
-- Includes
|
|
201
|
+
--[[
|
|
202
|
+
Move parent to a wait status (wait, prioritized or delayed)
|
|
144
203
|
]]
|
|
145
204
|
-- Includes
|
|
146
205
|
--[[
|
|
@@ -154,7 +213,7 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
|
154
213
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
|
155
214
|
if #result then
|
|
156
215
|
local nextTimestamp = tonumber(result[2])
|
|
157
|
-
if nextTimestamp ~= nil then
|
|
216
|
+
if nextTimestamp ~= nil then
|
|
158
217
|
return nextTimestamp / 0x1000
|
|
159
218
|
end
|
|
160
219
|
end
|
|
@@ -171,10 +230,16 @@ end
|
|
|
171
230
|
Function to add job considering priority.
|
|
172
231
|
]]
|
|
173
232
|
-- Includes
|
|
233
|
+
--[[
|
|
234
|
+
Function to get priority score.
|
|
235
|
+
]]
|
|
236
|
+
local function getPriorityScore(priority, priorityCounterKey)
|
|
237
|
+
local prioCounter = rcall("INCR", priorityCounterKey)
|
|
238
|
+
return priority * 0x100000000 + prioCounter % 0x100000000
|
|
239
|
+
end
|
|
174
240
|
local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
|
|
175
241
|
isPausedOrMaxed)
|
|
176
|
-
local
|
|
177
|
-
local score = priority * 0x100000000 + prioCounter % 0x100000000
|
|
242
|
+
local score = getPriorityScore(priority, priorityCounterKey)
|
|
178
243
|
rcall("ZADD", prioritizedKey, score, jobId)
|
|
179
244
|
addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
|
|
180
245
|
end
|
|
@@ -194,57 +259,64 @@ local function isQueuePausedOrMaxed(queueMetaKey, activeKey)
|
|
|
194
259
|
end
|
|
195
260
|
return false
|
|
196
261
|
end
|
|
197
|
-
local function
|
|
198
|
-
|
|
199
|
-
local
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
local
|
|
208
|
-
local
|
|
209
|
-
local
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
262
|
+
local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
263
|
+
local parentWaitKey = parentQueueKey .. ":wait"
|
|
264
|
+
local parentPausedKey = parentQueueKey .. ":paused"
|
|
265
|
+
local parentActiveKey = parentQueueKey .. ":active"
|
|
266
|
+
local parentMetaKey = parentQueueKey .. ":meta"
|
|
267
|
+
local parentMarkerKey = parentQueueKey .. ":marker"
|
|
268
|
+
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
|
269
|
+
local priority = tonumber(jobAttributes[1]) or 0
|
|
270
|
+
local delay = tonumber(jobAttributes[2]) or 0
|
|
271
|
+
if delay > 0 then
|
|
272
|
+
local delayedTimestamp = tonumber(timestamp) + delay
|
|
273
|
+
local score = delayedTimestamp * 0x1000
|
|
274
|
+
local parentDelayedKey = parentQueueKey .. ":delayed"
|
|
275
|
+
rcall("ZADD", parentDelayedKey, score, parentId)
|
|
276
|
+
rcall("XADD", parentQueueKey .. ":events", "*", "event", "delayed", "jobId", parentId, "delay",
|
|
277
|
+
delayedTimestamp)
|
|
278
|
+
addDelayMarkerIfNeeded(parentMarkerKey, parentDelayedKey)
|
|
279
|
+
else
|
|
280
|
+
if priority == 0 then
|
|
281
|
+
local parentTarget, isParentPausedOrMaxed = getTargetQueueList(parentMetaKey, parentActiveKey,
|
|
282
|
+
parentWaitKey, parentPausedKey)
|
|
283
|
+
addJobInTargetList(parentTarget, parentMarkerKey, "RPUSH", isParentPausedOrMaxed, parentId)
|
|
219
284
|
else
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
parentPausedKey)
|
|
224
|
-
addJobInTargetList(parentTarget, parentMarkerKey, "RPUSH", isParentPausedOrMaxed,
|
|
225
|
-
parentId)
|
|
226
|
-
else
|
|
227
|
-
local isPausedOrMaxed = isQueuePausedOrMaxed(parentMetaKey, parentActiveKey)
|
|
228
|
-
addJobWithPriority(parentMarkerKey,
|
|
229
|
-
parentQueueKey .. ":prioritized", priority,
|
|
230
|
-
parentId, parentQueueKey .. ":pc", isPausedOrMaxed)
|
|
231
|
-
end
|
|
232
|
-
rcall("XADD", parentQueueKey .. ":events", "*", "event", "waiting",
|
|
233
|
-
"jobId", parentId, "prev", "waiting-children")
|
|
285
|
+
local isPausedOrMaxed = isQueuePausedOrMaxed(parentMetaKey, parentActiveKey)
|
|
286
|
+
addJobWithPriority(parentMarkerKey, parentQueueKey .. ":prioritized", priority, parentId,
|
|
287
|
+
parentQueueKey .. ":pc", isPausedOrMaxed)
|
|
234
288
|
end
|
|
289
|
+
rcall("XADD", parentQueueKey .. ":events", "*", "event", "waiting", "jobId", parentId, "prev",
|
|
290
|
+
"waiting-children")
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
local function moveParentToWaitIfNeeded(parentQueueKey, parentKey, parentId, timestamp)
|
|
294
|
+
if rcall("EXISTS", parentKey) == 1 then
|
|
295
|
+
local parentWaitingChildrenKey = parentQueueKey .. ":waiting-children"
|
|
296
|
+
if rcall("ZSCORE", parentWaitingChildrenKey, parentId) then
|
|
297
|
+
rcall("ZREM", parentWaitingChildrenKey, parentId)
|
|
298
|
+
moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
235
299
|
end
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
local function moveParentToWaitIfNoPendingDependencies(parentQueueKey, parentDependenciesKey, parentKey,
|
|
303
|
+
parentId, timestamp)
|
|
304
|
+
local doNotHavePendingDependencies = rcall("SCARD", parentDependenciesKey) == 0
|
|
305
|
+
if doNotHavePendingDependencies then
|
|
306
|
+
moveParentToWaitIfNeeded(parentQueueKey, parentKey, parentId, timestamp)
|
|
307
|
+
end
|
|
236
308
|
end
|
|
237
309
|
local function updateParentDepsIfNeeded(parentKey, parentQueueKey, parentDependenciesKey,
|
|
238
310
|
parentId, jobIdKey, returnvalue, timestamp )
|
|
239
311
|
local processedSet = parentKey .. ":processed"
|
|
240
312
|
rcall("HSET", processedSet, jobIdKey, returnvalue)
|
|
241
|
-
|
|
313
|
+
moveParentToWaitIfNoPendingDependencies(parentQueueKey, parentDependenciesKey, parentKey, parentId, timestamp)
|
|
242
314
|
end
|
|
243
315
|
local function updateExistingJobsParent(parentKey, parent, parentData,
|
|
244
316
|
parentDependenciesKey, completedKey,
|
|
245
317
|
jobIdKey, jobId, timestamp)
|
|
246
318
|
if parentKey ~= nil then
|
|
247
|
-
if rcall("ZSCORE", completedKey, jobId)
|
|
319
|
+
if rcall("ZSCORE", completedKey, jobId) then
|
|
248
320
|
local returnvalue = rcall("HGET", jobIdKey, "returnvalue")
|
|
249
321
|
updateParentDepsIfNeeded(parentKey, parent['queueKey'],
|
|
250
322
|
parentDependenciesKey, parent['id'],
|
|
@@ -290,7 +362,7 @@ local function storeJob(eventsKey, jobIdKey, jobId, name, data, opts, timestamp,
|
|
|
290
362
|
table.insert(optionalValues, "parent")
|
|
291
363
|
table.insert(optionalValues, parentData)
|
|
292
364
|
end
|
|
293
|
-
if repeatJobKey
|
|
365
|
+
if repeatJobKey then
|
|
294
366
|
table.insert(optionalValues, "rjk")
|
|
295
367
|
table.insert(optionalValues, repeatJobKey)
|
|
296
368
|
end
|
|
@@ -325,18 +397,18 @@ else
|
|
|
325
397
|
maxEvents, timestamp)
|
|
326
398
|
end
|
|
327
399
|
end
|
|
328
|
-
local deduplicationJobId = deduplicateJob(
|
|
329
|
-
|
|
400
|
+
local deduplicationJobId = deduplicateJob(opts['de'], jobId, KEYS[6],
|
|
401
|
+
deduplicationKey, eventsKey, maxEvents, args[1])
|
|
330
402
|
if deduplicationJobId then
|
|
331
403
|
return deduplicationJobId
|
|
332
404
|
end
|
|
333
405
|
-- Store the job.
|
|
334
406
|
storeJob(eventsKey, jobIdKey, jobId, args[3], ARGV[2], opts, timestamp,
|
|
335
407
|
parentKey, parentData, repeatJobKey)
|
|
336
|
-
local target, isPausedOrMaxed = getTargetQueueList(metaKey, KEYS[
|
|
408
|
+
local target, isPausedOrMaxed = getTargetQueueList(metaKey, KEYS[7], KEYS[1], KEYS[2])
|
|
337
409
|
-- LIFO or FIFO
|
|
338
410
|
local pushCmd = opts['lifo'] and 'RPUSH' or 'LPUSH'
|
|
339
|
-
addJobInTargetList(target, KEYS[
|
|
411
|
+
addJobInTargetList(target, KEYS[9], pushCmd, isPausedOrMaxed, jobId)
|
|
340
412
|
-- Emit waiting event
|
|
341
413
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "waiting",
|
|
342
414
|
"jobId", jobId)
|
|
@@ -349,6 +421,6 @@ return jobId .. "" -- convert to string
|
|
|
349
421
|
exports.addStandardJob = {
|
|
350
422
|
name: 'addStandardJob',
|
|
351
423
|
content,
|
|
352
|
-
keys:
|
|
424
|
+
keys: 9,
|
|
353
425
|
};
|
|
354
|
-
//# sourceMappingURL=addStandardJob-
|
|
426
|
+
//# sourceMappingURL=addStandardJob-9.js.map
|
|
@@ -32,7 +32,7 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
|
32
32
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
|
33
33
|
if #result then
|
|
34
34
|
local nextTimestamp = tonumber(result[2])
|
|
35
|
-
if nextTimestamp ~= nil then
|
|
35
|
+
if nextTimestamp ~= nil then
|
|
36
36
|
return nextTimestamp / 0x1000
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -73,12 +73,12 @@ end
|
|
|
73
73
|
Function to get max events value or set by default 10000.
|
|
74
74
|
]]
|
|
75
75
|
local function getOrSetMaxEvents(metaKey)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
|
|
77
|
+
if not maxEvents then
|
|
78
|
+
maxEvents = 10000
|
|
79
|
+
rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
|
|
80
|
+
end
|
|
81
|
+
return maxEvents
|
|
82
82
|
end
|
|
83
83
|
if rcall("EXISTS", ARGV[4]) == 1 then
|
|
84
84
|
local jobId = ARGV[3]
|
|
@@ -44,10 +44,16 @@ end
|
|
|
44
44
|
Function to add job considering priority.
|
|
45
45
|
]]
|
|
46
46
|
-- Includes
|
|
47
|
+
--[[
|
|
48
|
+
Function to get priority score.
|
|
49
|
+
]]
|
|
50
|
+
local function getPriorityScore(priority, priorityCounterKey)
|
|
51
|
+
local prioCounter = rcall("INCR", priorityCounterKey)
|
|
52
|
+
return priority * 0x100000000 + prioCounter % 0x100000000
|
|
53
|
+
end
|
|
47
54
|
local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
|
|
48
55
|
isPausedOrMaxed)
|
|
49
|
-
local
|
|
50
|
-
local score = priority * 0x100000000 + prioCounter % 0x100000000
|
|
56
|
+
local score = getPriorityScore(priority, priorityCounterKey)
|
|
51
57
|
rcall("ZADD", prioritizedKey, score, jobId)
|
|
52
58
|
addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
|
|
53
59
|
end
|
|
@@ -6,13 +6,14 @@ const content = `--[[
|
|
|
6
6
|
Input:
|
|
7
7
|
KEYS[1] set key,
|
|
8
8
|
KEYS[2] events stream key
|
|
9
|
-
KEYS[3]
|
|
9
|
+
KEYS[3] repeat key
|
|
10
10
|
ARGV[1] jobKey prefix
|
|
11
11
|
ARGV[2] timestamp
|
|
12
12
|
ARGV[3] limit the number of jobs to be removed. 0 is unlimited
|
|
13
13
|
ARGV[4] set name, can be any of 'wait', 'active', 'paused', 'delayed', 'completed', or 'failed'
|
|
14
14
|
]]
|
|
15
15
|
local rcall = redis.call
|
|
16
|
+
local repeatKey = KEYS[3]
|
|
16
17
|
local rangeStart = 0
|
|
17
18
|
local rangeEnd = -1
|
|
18
19
|
local limit = tonumber(ARGV[3])
|
|
@@ -47,26 +48,46 @@ local function getTimestamp(jobKey, attributes)
|
|
|
47
48
|
end
|
|
48
49
|
return jobTs
|
|
49
50
|
end
|
|
51
|
+
--[[
|
|
52
|
+
Function to check if the job belongs to a job scheduler and
|
|
53
|
+
current delayed job matches with jobId
|
|
54
|
+
]]
|
|
55
|
+
local function isJobSchedulerJob(jobId, jobKey, jobSchedulersKey)
|
|
56
|
+
local repeatJobKey = rcall("HGET", jobKey, "rjk")
|
|
57
|
+
if repeatJobKey then
|
|
58
|
+
local prevMillis = rcall("ZSCORE", jobSchedulersKey, repeatJobKey)
|
|
59
|
+
if prevMillis then
|
|
60
|
+
local currentDelayedJobId = "repeat:" .. repeatJobKey .. ":" .. prevMillis
|
|
61
|
+
return jobId == currentDelayedJobId
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
return false
|
|
65
|
+
end
|
|
50
66
|
--[[
|
|
51
67
|
Function to remove job.
|
|
52
68
|
]]
|
|
53
69
|
-- Includes
|
|
54
70
|
--[[
|
|
55
|
-
Function to remove deduplication key
|
|
71
|
+
Function to remove deduplication key if needed
|
|
72
|
+
when a job is being removed.
|
|
56
73
|
]]
|
|
57
|
-
local function
|
|
74
|
+
local function removeDeduplicationKeyIfNeededOnRemoval(prefixKey,
|
|
75
|
+
jobKey, jobId)
|
|
58
76
|
local deduplicationId = rcall("HGET", jobKey, "deid")
|
|
59
77
|
if deduplicationId then
|
|
60
78
|
local deduplicationKey = prefixKey .. "de:" .. deduplicationId
|
|
61
|
-
rcall(
|
|
79
|
+
local currentJobId = rcall('GET', deduplicationKey)
|
|
80
|
+
if currentJobId and currentJobId == jobId then
|
|
81
|
+
return rcall("DEL", deduplicationKey)
|
|
82
|
+
end
|
|
62
83
|
end
|
|
63
84
|
end
|
|
64
85
|
--[[
|
|
65
86
|
Function to remove job keys.
|
|
66
87
|
]]
|
|
67
88
|
local function removeJobKeys(jobKey)
|
|
68
|
-
return rcall("DEL", jobKey, jobKey .. ':logs',
|
|
69
|
-
jobKey .. ':
|
|
89
|
+
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
90
|
+
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
70
91
|
end
|
|
71
92
|
--[[
|
|
72
93
|
Check if this job has a parent. If so we will just remove it from
|
|
@@ -120,7 +141,7 @@ local function getTargetQueueList(queueMetaKey, activeKey, waitKey, pausedKey)
|
|
|
120
141
|
end
|
|
121
142
|
return waitKey, false
|
|
122
143
|
end
|
|
123
|
-
local function
|
|
144
|
+
local function _moveParentToWait(parentPrefix, parentId, emitEvent)
|
|
124
145
|
local parentTarget, isPausedOrMaxed = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "active",
|
|
125
146
|
parentPrefix .. "wait", parentPrefix .. "paused")
|
|
126
147
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPausedOrMaxed, parentId)
|
|
@@ -148,10 +169,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey, debou
|
|
|
148
169
|
rcall("DEL", parentPrefix .. "de:" .. debounceId)
|
|
149
170
|
end
|
|
150
171
|
else
|
|
151
|
-
|
|
172
|
+
_moveParentToWait(parentPrefix, parentId)
|
|
152
173
|
end
|
|
153
174
|
else
|
|
154
|
-
|
|
175
|
+
_moveParentToWait(parentPrefix, parentId, true)
|
|
155
176
|
end
|
|
156
177
|
end
|
|
157
178
|
end
|
|
@@ -179,10 +200,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey, debou
|
|
|
179
200
|
rcall("DEL", parentPrefix .. "de:" .. parentAttributes[2])
|
|
180
201
|
end
|
|
181
202
|
else
|
|
182
|
-
|
|
203
|
+
_moveParentToWait(parentPrefix, parentId)
|
|
183
204
|
end
|
|
184
205
|
else
|
|
185
|
-
|
|
206
|
+
_moveParentToWait(parentPrefix, parentId, true)
|
|
186
207
|
end
|
|
187
208
|
end
|
|
188
209
|
end
|
|
@@ -196,12 +217,12 @@ local function removeJob(jobId, hard, baseKey, shouldRemoveDeduplicationKey)
|
|
|
196
217
|
local jobKey = baseKey .. jobId
|
|
197
218
|
removeParentDependencyKey(jobKey, hard, nil, baseKey)
|
|
198
219
|
if shouldRemoveDeduplicationKey then
|
|
199
|
-
|
|
220
|
+
removeDeduplicationKeyIfNeededOnRemoval(baseKey, jobKey, jobId)
|
|
200
221
|
end
|
|
201
222
|
removeJobKeys(jobKey)
|
|
202
223
|
end
|
|
203
224
|
local function cleanList(listKey, jobKeyPrefix, rangeStart, rangeEnd,
|
|
204
|
-
timestamp, isWaiting)
|
|
225
|
+
timestamp, isWaiting, jobSchedulersKey)
|
|
205
226
|
local jobs = rcall("LRANGE", listKey, rangeStart, rangeEnd)
|
|
206
227
|
local deleted = {}
|
|
207
228
|
local deletedCount = 0
|
|
@@ -213,7 +234,8 @@ local function cleanList(listKey, jobKeyPrefix, rangeStart, rangeEnd,
|
|
|
213
234
|
break
|
|
214
235
|
end
|
|
215
236
|
local jobKey = jobKeyPrefix .. job
|
|
216
|
-
if (isWaiting or rcall("EXISTS", jobKey .. ":lock") == 0)
|
|
237
|
+
if (isWaiting or rcall("EXISTS", jobKey .. ":lock") == 0) and
|
|
238
|
+
not isJobSchedulerJob(job, jobKey, jobSchedulersKey) then
|
|
217
239
|
-- Find the right timestamp of the job to compare to maxTimestamp:
|
|
218
240
|
-- * finishedOn says when the job was completed, but it isn't set unless the job has actually completed
|
|
219
241
|
-- * processedOn represents when the job was last attempted, but it doesn't get populated until
|
|
@@ -269,15 +291,6 @@ local function getJobsInZset(zsetKey, rangeEnd, limit)
|
|
|
269
291
|
return rcall("ZRANGEBYSCORE", zsetKey, 0, rangeEnd)
|
|
270
292
|
end
|
|
271
293
|
end
|
|
272
|
-
local function isJobSchedulerJob(jobId, jobSchedulersKey)
|
|
273
|
-
if jobSchedulersKey then
|
|
274
|
-
local jobSchedulerId = jobId:match("repeat:(.*):%d+")
|
|
275
|
-
if jobSchedulerId then
|
|
276
|
-
return rcall("ZSCORE", jobSchedulersKey, jobSchedulerId)
|
|
277
|
-
end
|
|
278
|
-
end
|
|
279
|
-
return false
|
|
280
|
-
end
|
|
281
294
|
local function cleanSet(
|
|
282
295
|
setKey,
|
|
283
296
|
jobKeyPrefix,
|
|
@@ -295,10 +308,10 @@ local function cleanSet(
|
|
|
295
308
|
if limit > 0 and deletedCount >= limit then
|
|
296
309
|
break
|
|
297
310
|
end
|
|
311
|
+
local jobKey = jobKeyPrefix .. job
|
|
298
312
|
-- Extract a Job Scheduler Id from jobId ("repeat:job-scheduler-id:millis")
|
|
299
313
|
-- and check if it is in the scheduled jobs
|
|
300
|
-
if not isJobSchedulerJob(job, jobSchedulersKey) then
|
|
301
|
-
local jobKey = jobKeyPrefix .. job
|
|
314
|
+
if not (jobSchedulersKey and isJobSchedulerJob(job, jobKey, jobSchedulersKey)) then
|
|
302
315
|
if isFinished then
|
|
303
316
|
removeJob(job, true, jobKeyPrefix, true --[[remove debounce key]] )
|
|
304
317
|
deletedCount = deletedCount + 1
|
|
@@ -323,19 +336,22 @@ local function cleanSet(
|
|
|
323
336
|
end
|
|
324
337
|
local result
|
|
325
338
|
if ARGV[4] == "active" then
|
|
326
|
-
result = cleanList(KEYS[1], ARGV[1], rangeStart, rangeEnd, ARGV[2], false --[[ hasFinished ]]
|
|
339
|
+
result = cleanList(KEYS[1], ARGV[1], rangeStart, rangeEnd, ARGV[2], false --[[ hasFinished ]],
|
|
340
|
+
repeatKey)
|
|
327
341
|
elseif ARGV[4] == "delayed" then
|
|
328
342
|
rangeEnd = "+inf"
|
|
329
343
|
result = cleanSet(KEYS[1], ARGV[1], rangeEnd, ARGV[2], limit,
|
|
330
|
-
{"processedOn", "timestamp"}, false --[[ hasFinished ]],
|
|
344
|
+
{"processedOn", "timestamp"}, false --[[ hasFinished ]], repeatKey)
|
|
331
345
|
elseif ARGV[4] == "prioritized" then
|
|
332
346
|
rangeEnd = "+inf"
|
|
333
347
|
result = cleanSet(KEYS[1], ARGV[1], rangeEnd, ARGV[2], limit,
|
|
334
|
-
{"timestamp"}, false --[[ hasFinished ]])
|
|
348
|
+
{"timestamp"}, false --[[ hasFinished ]], repeatKey)
|
|
335
349
|
elseif ARGV[4] == "wait" or ARGV[4] == "paused" then
|
|
336
|
-
result = cleanList(KEYS[1], ARGV[1], rangeStart, rangeEnd, ARGV[2], true --[[ hasFinished ]]
|
|
350
|
+
result = cleanList(KEYS[1], ARGV[1], rangeStart, rangeEnd, ARGV[2], true --[[ hasFinished ]],
|
|
351
|
+
repeatKey)
|
|
337
352
|
else
|
|
338
353
|
rangeEnd = ARGV[2]
|
|
354
|
+
-- No need to pass repeat key as in that moment job won't be related to a job scheduler
|
|
339
355
|
result = cleanSet(KEYS[1], ARGV[1], rangeEnd, ARGV[2], limit,
|
|
340
356
|
{"finishedOn"}, true --[[ hasFinished ]])
|
|
341
357
|
end
|