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