@tachybase/plugin-adapter-bullmq 1.3.17 → 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.
Files changed (347) hide show
  1. package/dist/externalVersion.js +2 -2
  2. package/dist/node_modules/@bull-board/api/dist/src/handlers/error.d.ts +4 -2
  3. package/dist/node_modules/@bull-board/api/dist/src/handlers/error.js +2 -2
  4. package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseAll.d.ts +4 -0
  5. package/dist/node_modules/@bull-board/api/dist/src/handlers/pauseAll.js +15 -0
  6. package/dist/node_modules/@bull-board/api/dist/src/handlers/queues.js +4 -0
  7. package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeAll.d.ts +4 -0
  8. package/dist/node_modules/@bull-board/api/dist/src/handlers/resumeAll.js +15 -0
  9. package/dist/node_modules/@bull-board/api/dist/src/index.js +1 -1
  10. package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.d.ts +4 -0
  11. package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/base.js +6 -0
  12. package/dist/node_modules/@bull-board/api/dist/src/queueAdapters/bull.js +6 -4
  13. package/dist/node_modules/@bull-board/api/dist/src/routes.js +4 -0
  14. package/dist/node_modules/@bull-board/api/dist/typings/app.d.ts +22 -2
  15. package/dist/node_modules/@bull-board/api/package.json +1 -1
  16. package/dist/node_modules/@bull-board/koa/dist/KoaAdapter.js +1 -1
  17. package/dist/node_modules/@bull-board/koa/dist/index.js +101 -101
  18. package/dist/node_modules/@bull-board/koa/package.json +1 -1
  19. package/dist/node_modules/bullmq/dist/cjs/classes/backoffs.js +18 -5
  20. package/dist/node_modules/bullmq/dist/cjs/classes/child-pool.js +7 -2
  21. package/dist/node_modules/bullmq/dist/cjs/classes/child-processor.js +59 -5
  22. package/dist/node_modules/bullmq/dist/cjs/classes/child.js +3 -1
  23. package/dist/node_modules/bullmq/dist/cjs/classes/errors/index.js +2 -1
  24. package/dist/node_modules/bullmq/dist/cjs/classes/errors/waiting-error.js +19 -0
  25. package/dist/node_modules/bullmq/dist/cjs/classes/flow-producer.js +21 -5
  26. package/dist/node_modules/bullmq/dist/cjs/classes/index.js +1 -0
  27. package/dist/node_modules/bullmq/dist/cjs/classes/job-scheduler.js +88 -62
  28. package/dist/node_modules/bullmq/dist/cjs/classes/job.js +216 -109
  29. package/dist/node_modules/bullmq/dist/cjs/classes/main-base.js +1 -1
  30. package/dist/node_modules/bullmq/dist/cjs/classes/queue-base.js +10 -9
  31. package/dist/node_modules/bullmq/dist/cjs/classes/queue-getters.js +34 -14
  32. package/dist/node_modules/bullmq/dist/cjs/classes/queue.js +19 -13
  33. package/dist/node_modules/bullmq/dist/cjs/classes/redis-connection.js +16 -9
  34. package/dist/node_modules/bullmq/dist/cjs/classes/repeat.js +1 -1
  35. package/dist/node_modules/bullmq/dist/cjs/classes/sandbox.js +54 -28
  36. package/dist/node_modules/bullmq/dist/cjs/classes/scripts.js +141 -39
  37. package/dist/node_modules/bullmq/dist/cjs/classes/worker.js +191 -182
  38. package/dist/node_modules/bullmq/dist/cjs/commands/addDelayedJob-6.lua +6 -17
  39. package/dist/node_modules/bullmq/dist/cjs/commands/addJobScheduler-11.lua +123 -0
  40. package/dist/node_modules/bullmq/dist/{esm/commands/addParentJob-4.lua → cjs/commands/addParentJob-5.lua} +7 -6
  41. package/dist/node_modules/bullmq/dist/cjs/commands/{addPrioritizedJob-8.lua → addPrioritizedJob-9.lua} +11 -10
  42. package/dist/node_modules/bullmq/dist/cjs/commands/addRepeatableJob-2.lua +2 -2
  43. package/dist/node_modules/bullmq/dist/{esm/commands/addStandardJob-8.lua → cjs/commands/addStandardJob-9.lua} +9 -8
  44. package/dist/node_modules/bullmq/dist/cjs/commands/cleanJobsInSet-3.lua +9 -5
  45. package/dist/node_modules/bullmq/dist/cjs/commands/drain-5.lua +16 -16
  46. package/dist/node_modules/bullmq/dist/cjs/commands/getDependencyCounts-4.lua +31 -0
  47. package/dist/node_modules/bullmq/dist/cjs/commands/getState-8.lua +5 -5
  48. package/dist/node_modules/bullmq/dist/cjs/commands/getStateV2-8.lua +8 -8
  49. package/dist/node_modules/bullmq/dist/cjs/commands/includes/addDelayedJob.lua +23 -0
  50. package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobFromScheduler.lua +37 -0
  51. package/dist/node_modules/bullmq/dist/cjs/commands/includes/addJobWithPriority.lua +2 -2
  52. package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanList.lua +4 -2
  53. package/dist/node_modules/bullmq/dist/cjs/commands/includes/cleanSet.lua +3 -11
  54. package/dist/node_modules/bullmq/dist/cjs/commands/includes/collectMetrics.lua +1 -1
  55. package/dist/node_modules/bullmq/dist/cjs/commands/includes/deduplicateJob.lua +63 -18
  56. package/dist/node_modules/bullmq/dist/cjs/commands/includes/filterOutJobsToIgnore.lua +14 -0
  57. package/dist/node_modules/bullmq/dist/cjs/commands/includes/getNextDelayedTimestamp.lua +1 -1
  58. package/dist/node_modules/bullmq/dist/cjs/commands/includes/getOrSetMaxEvents.lua +6 -6
  59. package/dist/node_modules/bullmq/dist/cjs/commands/includes/getPriorityScore.lua +8 -0
  60. package/dist/node_modules/bullmq/dist/cjs/commands/includes/isJobSchedulerJob.lua +15 -0
  61. package/dist/node_modules/bullmq/dist/cjs/commands/includes/isLocked.lua +1 -0
  62. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveChildFromDependenciesIfNeeded.lua +77 -0
  63. package/dist/node_modules/bullmq/dist/cjs/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
  64. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWait.lua +45 -0
  65. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWaitIfNeeded.lua +9 -50
  66. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentToWaitIfNoPendingDependencies.lua +13 -0
  67. package/dist/node_modules/bullmq/dist/cjs/commands/includes/prepareJobForProcessing.lua +2 -1
  68. package/dist/node_modules/bullmq/dist/cjs/commands/includes/promoteDelayedJobs.lua +7 -3
  69. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeededOnFinalization.lua +23 -0
  70. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeededOnRemoval.lua +16 -0
  71. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJob.lua +2 -2
  72. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobKeys.lua +2 -2
  73. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeJobWithChildren.lua +95 -0
  74. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeListJobs.lua +7 -1
  75. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeParentDependencyKey.lua +5 -5
  76. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeZSetJobs.lua +2 -8
  77. package/dist/node_modules/bullmq/dist/cjs/commands/includes/storeJob.lua +2 -2
  78. package/dist/node_modules/bullmq/dist/cjs/commands/includes/storeJobScheduler.lua +52 -0
  79. package/dist/node_modules/bullmq/dist/cjs/commands/includes/trimEvents.lua +1 -1
  80. package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateExistingJobsParent.lua +1 -1
  81. package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateJobFields.lua +5 -5
  82. package/dist/node_modules/bullmq/dist/cjs/commands/includes/updateParentDepsIfNeeded.lua +2 -2
  83. package/dist/node_modules/bullmq/dist/cjs/commands/isFinished-3.lua +2 -2
  84. package/dist/node_modules/bullmq/dist/cjs/commands/moveJobFromActiveToWait-9.lua +63 -0
  85. package/dist/node_modules/bullmq/dist/cjs/commands/moveStalledJobsToWait-8.lua +109 -0
  86. package/dist/node_modules/bullmq/dist/cjs/commands/moveToActive-11.lua +3 -2
  87. package/dist/node_modules/bullmq/dist/cjs/commands/moveToFinished-14.lua +52 -52
  88. package/dist/node_modules/bullmq/dist/cjs/commands/moveToWaitingChildren-8.lua +106 -0
  89. package/dist/node_modules/bullmq/dist/cjs/commands/removeJob-2.lua +18 -66
  90. package/dist/node_modules/bullmq/dist/cjs/commands/removeJobScheduler-3.lua +1 -1
  91. package/dist/node_modules/bullmq/dist/cjs/commands/removeUnprocessedChildren-2.lua +31 -0
  92. package/dist/node_modules/bullmq/dist/cjs/commands/retryJob-11.lua +11 -5
  93. package/dist/node_modules/bullmq/dist/cjs/commands/updateJobScheduler-12.lua +90 -0
  94. package/dist/node_modules/bullmq/dist/cjs/commands/updateRepeatableJobMillis-1.lua +1 -1
  95. package/dist/node_modules/bullmq/dist/cjs/enums/child-command.js +2 -0
  96. package/dist/node_modules/bullmq/dist/cjs/enums/error-code.js +2 -1
  97. package/dist/node_modules/bullmq/dist/cjs/enums/parent-command.js +5 -2
  98. package/dist/node_modules/bullmq/dist/cjs/index.js +1 -1
  99. package/dist/node_modules/bullmq/dist/cjs/interfaces/index.js +2 -1
  100. package/dist/node_modules/bullmq/dist/cjs/interfaces/{debounce-options.js → parent-options.js} +1 -1
  101. package/dist/node_modules/bullmq/dist/cjs/interfaces/receiver.js +3 -0
  102. package/dist/node_modules/bullmq/dist/cjs/scripts/addDelayedJob-6.js +163 -84
  103. package/dist/node_modules/bullmq/dist/cjs/scripts/addJobScheduler-11.js +465 -0
  104. package/dist/node_modules/bullmq/dist/cjs/scripts/{addParentJob-4.js → addParentJob-5.js} +147 -75
  105. package/dist/node_modules/bullmq/dist/cjs/scripts/{addPrioritizedJob-8.js → addPrioritizedJob-9.js} +151 -79
  106. package/dist/node_modules/bullmq/dist/cjs/scripts/addRepeatableJob-2.js +18 -13
  107. package/dist/node_modules/bullmq/dist/cjs/scripts/{addStandardJob-8.js → addStandardJob-9.js} +149 -77
  108. package/dist/node_modules/bullmq/dist/cjs/scripts/changeDelay-4.js +7 -7
  109. package/dist/node_modules/bullmq/dist/cjs/scripts/changePriority-7.js +8 -2
  110. package/dist/node_modules/bullmq/dist/cjs/scripts/cleanJobsInSet-3.js +45 -29
  111. package/dist/node_modules/bullmq/dist/cjs/scripts/drain-5.js +49 -35
  112. package/dist/node_modules/bullmq/dist/cjs/scripts/getDependencyCounts-4.js +37 -0
  113. package/dist/node_modules/bullmq/dist/cjs/scripts/getState-8.js +5 -5
  114. package/dist/node_modules/bullmq/dist/cjs/scripts/getStateV2-8.js +8 -8
  115. package/dist/node_modules/bullmq/dist/cjs/scripts/index.js +10 -7
  116. package/dist/node_modules/bullmq/dist/cjs/scripts/isFinished-3.js +2 -2
  117. package/dist/node_modules/bullmq/dist/cjs/scripts/{moveJobFromActiveToWait-10.js → moveJobFromActiveToWait-9.js} +57 -37
  118. package/dist/node_modules/bullmq/dist/cjs/scripts/moveJobsToWait-8.js +6 -6
  119. package/dist/node_modules/bullmq/dist/cjs/scripts/moveStalledJobsToWait-8.js +171 -0
  120. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToActive-11.js +18 -8
  121. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToDelayed-8.js +12 -12
  122. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToFinished-14.js +218 -155
  123. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToWaitingChildren-8.js +529 -0
  124. package/dist/node_modules/bullmq/dist/cjs/scripts/obliterate-2.js +33 -20
  125. package/dist/node_modules/bullmq/dist/cjs/scripts/pause-7.js +1 -1
  126. package/dist/node_modules/bullmq/dist/cjs/scripts/promote-9.js +8 -2
  127. package/dist/node_modules/bullmq/dist/cjs/scripts/removeChildDependency-1.js +7 -7
  128. package/dist/node_modules/bullmq/dist/cjs/scripts/removeJob-2.js +120 -63
  129. package/dist/node_modules/bullmq/dist/cjs/scripts/removeJobScheduler-3.js +3 -3
  130. package/dist/node_modules/bullmq/dist/cjs/scripts/removeRepeatable-3.js +2 -2
  131. package/dist/node_modules/bullmq/dist/cjs/scripts/removeUnprocessedChildren-2.js +339 -0
  132. package/dist/node_modules/bullmq/dist/cjs/scripts/reprocessJob-8.js +6 -6
  133. package/dist/node_modules/bullmq/dist/cjs/scripts/retryJob-11.js +47 -26
  134. package/dist/node_modules/bullmq/dist/cjs/scripts/updateJobScheduler-12.js +274 -0
  135. package/dist/node_modules/bullmq/dist/cjs/scripts/updateProgress-3.js +6 -6
  136. package/dist/node_modules/bullmq/dist/cjs/scripts/updateRepeatableJobMillis-1.js +1 -1
  137. package/dist/node_modules/bullmq/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  138. package/dist/node_modules/bullmq/dist/cjs/types/deduplication-options.js +3 -0
  139. package/dist/node_modules/bullmq/dist/cjs/types/index.js +3 -0
  140. package/dist/node_modules/bullmq/dist/cjs/types/job-progress.js +3 -0
  141. package/dist/node_modules/bullmq/dist/cjs/types/script-queue-context.js +3 -0
  142. package/dist/node_modules/bullmq/dist/cjs/utils.js +29 -1
  143. package/dist/node_modules/bullmq/dist/cjs/version.js +1 -1
  144. package/dist/node_modules/bullmq/dist/esm/classes/backoffs.d.ts +1 -1
  145. package/dist/node_modules/bullmq/dist/esm/classes/backoffs.js +18 -5
  146. package/dist/node_modules/bullmq/dist/esm/classes/child-pool.d.ts +1 -1
  147. package/dist/node_modules/bullmq/dist/esm/classes/child-pool.js +7 -2
  148. package/dist/node_modules/bullmq/dist/esm/classes/child-processor.d.ts +3 -2
  149. package/dist/node_modules/bullmq/dist/esm/classes/child-processor.js +59 -5
  150. package/dist/node_modules/bullmq/dist/esm/classes/child.js +3 -1
  151. package/dist/node_modules/bullmq/dist/esm/classes/errors/index.d.ts +2 -1
  152. package/dist/node_modules/bullmq/dist/esm/classes/errors/index.js +2 -1
  153. package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-error.d.ts +10 -0
  154. package/dist/node_modules/bullmq/dist/esm/classes/errors/waiting-error.js +15 -0
  155. package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.d.ts +3 -9
  156. package/dist/node_modules/bullmq/dist/esm/classes/flow-producer.js +21 -5
  157. package/dist/node_modules/bullmq/dist/esm/classes/index.d.ts +1 -0
  158. package/dist/node_modules/bullmq/dist/esm/classes/index.js +1 -0
  159. package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.d.ts +2 -2
  160. package/dist/node_modules/bullmq/dist/esm/classes/job-scheduler.js +88 -62
  161. package/dist/node_modules/bullmq/dist/esm/classes/job.d.ts +69 -19
  162. package/dist/node_modules/bullmq/dist/esm/classes/job.js +217 -110
  163. package/dist/node_modules/bullmq/dist/esm/classes/main-base.d.ts +2 -3
  164. package/dist/node_modules/bullmq/dist/esm/classes/main-base.js +1 -1
  165. package/dist/node_modules/bullmq/dist/esm/classes/queue-base.d.ts +2 -5
  166. package/dist/node_modules/bullmq/dist/esm/classes/queue-base.js +11 -10
  167. package/dist/node_modules/bullmq/dist/esm/classes/queue-events-producer.d.ts +2 -2
  168. package/dist/node_modules/bullmq/dist/esm/classes/queue-events.d.ts +118 -29
  169. package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.d.ts +20 -13
  170. package/dist/node_modules/bullmq/dist/esm/classes/queue-getters.js +34 -14
  171. package/dist/node_modules/bullmq/dist/esm/classes/queue.d.ts +19 -16
  172. package/dist/node_modules/bullmq/dist/esm/classes/queue.js +19 -13
  173. package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.d.ts +7 -3
  174. package/dist/node_modules/bullmq/dist/esm/classes/redis-connection.js +16 -9
  175. package/dist/node_modules/bullmq/dist/esm/classes/repeat.js +1 -1
  176. package/dist/node_modules/bullmq/dist/esm/classes/sandbox.js +54 -28
  177. package/dist/node_modules/bullmq/dist/esm/classes/scripts.d.ts +20 -13
  178. package/dist/node_modules/bullmq/dist/esm/classes/scripts.js +141 -39
  179. package/dist/node_modules/bullmq/dist/esm/classes/worker.d.ts +28 -7
  180. package/dist/node_modules/bullmq/dist/esm/classes/worker.js +192 -183
  181. package/dist/node_modules/bullmq/dist/esm/commands/addDelayedJob-6.lua +6 -17
  182. package/dist/node_modules/bullmq/dist/esm/commands/addJobScheduler-11.lua +123 -0
  183. package/dist/node_modules/bullmq/dist/{cjs/commands/addParentJob-4.lua → esm/commands/addParentJob-5.lua} +7 -6
  184. package/dist/node_modules/bullmq/dist/esm/commands/{addPrioritizedJob-8.lua → addPrioritizedJob-9.lua} +11 -10
  185. package/dist/node_modules/bullmq/dist/esm/commands/addRepeatableJob-2.lua +2 -2
  186. package/dist/node_modules/bullmq/dist/{cjs/commands/addStandardJob-8.lua → esm/commands/addStandardJob-9.lua} +9 -8
  187. package/dist/node_modules/bullmq/dist/esm/commands/cleanJobsInSet-3.lua +9 -5
  188. package/dist/node_modules/bullmq/dist/esm/commands/drain-5.lua +16 -16
  189. package/dist/node_modules/bullmq/dist/esm/commands/getDependencyCounts-4.lua +31 -0
  190. package/dist/node_modules/bullmq/dist/esm/commands/getState-8.lua +5 -5
  191. package/dist/node_modules/bullmq/dist/esm/commands/getStateV2-8.lua +8 -8
  192. package/dist/node_modules/bullmq/dist/esm/commands/includes/addDelayedJob.lua +23 -0
  193. package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobFromScheduler.lua +37 -0
  194. package/dist/node_modules/bullmq/dist/esm/commands/includes/addJobWithPriority.lua +2 -2
  195. package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanList.lua +4 -2
  196. package/dist/node_modules/bullmq/dist/esm/commands/includes/cleanSet.lua +3 -11
  197. package/dist/node_modules/bullmq/dist/esm/commands/includes/collectMetrics.lua +1 -1
  198. package/dist/node_modules/bullmq/dist/esm/commands/includes/deduplicateJob.lua +63 -18
  199. package/dist/node_modules/bullmq/dist/esm/commands/includes/filterOutJobsToIgnore.lua +14 -0
  200. package/dist/node_modules/bullmq/dist/esm/commands/includes/getNextDelayedTimestamp.lua +1 -1
  201. package/dist/node_modules/bullmq/dist/esm/commands/includes/getOrSetMaxEvents.lua +6 -6
  202. package/dist/node_modules/bullmq/dist/esm/commands/includes/getPriorityScore.lua +8 -0
  203. package/dist/node_modules/bullmq/dist/esm/commands/includes/isJobSchedulerJob.lua +15 -0
  204. package/dist/node_modules/bullmq/dist/esm/commands/includes/isLocked.lua +1 -0
  205. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveChildFromDependenciesIfNeeded.lua +77 -0
  206. package/dist/node_modules/bullmq/dist/esm/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
  207. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWait.lua +45 -0
  208. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWaitIfNeeded.lua +9 -50
  209. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentToWaitIfNoPendingDependencies.lua +13 -0
  210. package/dist/node_modules/bullmq/dist/esm/commands/includes/prepareJobForProcessing.lua +2 -1
  211. package/dist/node_modules/bullmq/dist/esm/commands/includes/promoteDelayedJobs.lua +7 -3
  212. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeededOnFinalization.lua +23 -0
  213. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeededOnRemoval.lua +16 -0
  214. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJob.lua +2 -2
  215. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobKeys.lua +2 -2
  216. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeJobWithChildren.lua +95 -0
  217. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeListJobs.lua +7 -1
  218. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeParentDependencyKey.lua +5 -5
  219. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeZSetJobs.lua +2 -8
  220. package/dist/node_modules/bullmq/dist/esm/commands/includes/storeJob.lua +2 -2
  221. package/dist/node_modules/bullmq/dist/esm/commands/includes/storeJobScheduler.lua +52 -0
  222. package/dist/node_modules/bullmq/dist/esm/commands/includes/trimEvents.lua +1 -1
  223. package/dist/node_modules/bullmq/dist/esm/commands/includes/updateExistingJobsParent.lua +1 -1
  224. package/dist/node_modules/bullmq/dist/esm/commands/includes/updateJobFields.lua +5 -5
  225. package/dist/node_modules/bullmq/dist/esm/commands/includes/updateParentDepsIfNeeded.lua +2 -2
  226. package/dist/node_modules/bullmq/dist/esm/commands/isFinished-3.lua +2 -2
  227. package/dist/node_modules/bullmq/dist/esm/commands/moveJobFromActiveToWait-9.lua +63 -0
  228. package/dist/node_modules/bullmq/dist/esm/commands/moveStalledJobsToWait-8.lua +109 -0
  229. package/dist/node_modules/bullmq/dist/esm/commands/moveToActive-11.lua +3 -2
  230. package/dist/node_modules/bullmq/dist/esm/commands/moveToFinished-14.lua +52 -52
  231. package/dist/node_modules/bullmq/dist/esm/commands/moveToWaitingChildren-8.lua +106 -0
  232. package/dist/node_modules/bullmq/dist/esm/commands/removeJob-2.lua +18 -66
  233. package/dist/node_modules/bullmq/dist/esm/commands/removeJobScheduler-3.lua +1 -1
  234. package/dist/node_modules/bullmq/dist/esm/commands/removeUnprocessedChildren-2.lua +31 -0
  235. package/dist/node_modules/bullmq/dist/esm/commands/retryJob-11.lua +11 -5
  236. package/dist/node_modules/bullmq/dist/esm/commands/updateJobScheduler-12.lua +90 -0
  237. package/dist/node_modules/bullmq/dist/esm/commands/updateRepeatableJobMillis-1.lua +1 -1
  238. package/dist/node_modules/bullmq/dist/esm/enums/child-command.d.ts +3 -1
  239. package/dist/node_modules/bullmq/dist/esm/enums/child-command.js +2 -0
  240. package/dist/node_modules/bullmq/dist/esm/enums/error-code.d.ts +3 -2
  241. package/dist/node_modules/bullmq/dist/esm/enums/error-code.js +2 -1
  242. package/dist/node_modules/bullmq/dist/esm/enums/parent-command.d.ts +5 -2
  243. package/dist/node_modules/bullmq/dist/esm/enums/parent-command.js +5 -2
  244. package/dist/node_modules/bullmq/dist/esm/interfaces/backoff-options.d.ts +5 -0
  245. package/dist/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts +3 -9
  246. package/dist/node_modules/bullmq/dist/esm/interfaces/child-message.d.ts +1 -0
  247. package/dist/node_modules/bullmq/dist/esm/interfaces/index.d.ts +2 -1
  248. package/dist/node_modules/bullmq/dist/esm/interfaces/index.js +2 -1
  249. package/dist/node_modules/bullmq/dist/esm/interfaces/job-json.d.ts +6 -2
  250. package/dist/node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.d.ts +7 -4
  251. package/dist/node_modules/bullmq/dist/esm/interfaces/minimal-job.d.ts +34 -15
  252. package/dist/node_modules/bullmq/dist/esm/interfaces/parent-options.d.ts +11 -0
  253. package/dist/node_modules/bullmq/dist/esm/interfaces/parent-options.js +2 -0
  254. package/dist/node_modules/bullmq/dist/esm/interfaces/parent.d.ts +6 -2
  255. package/dist/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts +15 -6
  256. package/dist/node_modules/bullmq/dist/esm/interfaces/receiver.d.ts +4 -0
  257. package/dist/node_modules/bullmq/dist/esm/interfaces/receiver.js +2 -0
  258. package/dist/node_modules/bullmq/dist/esm/interfaces/repeat-options.d.ts +1 -2
  259. package/dist/node_modules/bullmq/dist/esm/interfaces/repeatable-options.d.ts +2 -0
  260. package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-job.d.ts +3 -2
  261. package/dist/node_modules/bullmq/dist/esm/interfaces/sandboxed-options.d.ts +1 -1
  262. package/dist/node_modules/bullmq/dist/esm/interfaces/telemetry.d.ts +18 -15
  263. package/dist/node_modules/bullmq/dist/esm/interfaces/worker-options.d.ts +10 -10
  264. package/dist/node_modules/bullmq/dist/esm/scripts/addDelayedJob-6.js +163 -84
  265. package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-11.js +462 -0
  266. package/dist/node_modules/bullmq/dist/esm/scripts/{addParentJob-4.js → addParentJob-5.js} +147 -75
  267. package/dist/node_modules/bullmq/dist/esm/scripts/{addPrioritizedJob-8.js → addPrioritizedJob-9.js} +151 -79
  268. package/dist/node_modules/bullmq/dist/esm/scripts/addRepeatableJob-2.js +18 -13
  269. package/dist/node_modules/bullmq/dist/esm/scripts/{addStandardJob-8.js → addStandardJob-9.js} +149 -77
  270. package/dist/node_modules/bullmq/dist/esm/scripts/changeDelay-4.js +7 -7
  271. package/dist/node_modules/bullmq/dist/esm/scripts/changePriority-7.js +8 -2
  272. package/dist/node_modules/bullmq/dist/esm/scripts/cleanJobsInSet-3.js +45 -29
  273. package/dist/node_modules/bullmq/dist/esm/scripts/drain-5.js +49 -35
  274. package/dist/node_modules/bullmq/dist/esm/scripts/getDependencyCounts-4.d.ts +5 -0
  275. package/dist/node_modules/bullmq/dist/esm/scripts/getDependencyCounts-4.js +34 -0
  276. package/dist/node_modules/bullmq/dist/esm/scripts/getState-8.js +5 -5
  277. package/dist/node_modules/bullmq/dist/esm/scripts/getStateV2-8.js +8 -8
  278. package/dist/node_modules/bullmq/dist/esm/scripts/index.d.ts +10 -7
  279. package/dist/node_modules/bullmq/dist/esm/scripts/index.js +10 -7
  280. package/dist/node_modules/bullmq/dist/esm/scripts/isFinished-3.js +2 -2
  281. package/dist/node_modules/bullmq/dist/esm/scripts/{moveJobFromActiveToWait-10.js → moveJobFromActiveToWait-9.js} +57 -37
  282. package/dist/node_modules/bullmq/dist/esm/scripts/moveJobsToWait-8.js +6 -6
  283. package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-8.js +168 -0
  284. package/dist/node_modules/bullmq/dist/esm/scripts/moveToActive-11.js +18 -8
  285. package/dist/node_modules/bullmq/dist/esm/scripts/moveToDelayed-8.js +12 -12
  286. package/dist/node_modules/bullmq/dist/esm/scripts/moveToFinished-14.js +218 -155
  287. package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-8.js +526 -0
  288. package/dist/node_modules/bullmq/dist/esm/scripts/obliterate-2.js +33 -20
  289. package/dist/node_modules/bullmq/dist/esm/scripts/pause-7.js +1 -1
  290. package/dist/node_modules/bullmq/dist/esm/scripts/promote-9.js +8 -2
  291. package/dist/node_modules/bullmq/dist/esm/scripts/removeChildDependency-1.js +7 -7
  292. package/dist/node_modules/bullmq/dist/esm/scripts/removeJob-2.js +120 -63
  293. package/dist/node_modules/bullmq/dist/esm/scripts/removeJobScheduler-3.js +3 -3
  294. package/dist/node_modules/bullmq/dist/esm/scripts/removeRepeatable-3.js +2 -2
  295. package/dist/node_modules/bullmq/dist/esm/scripts/removeUnprocessedChildren-2.d.ts +5 -0
  296. package/dist/node_modules/bullmq/dist/esm/scripts/removeUnprocessedChildren-2.js +336 -0
  297. package/dist/node_modules/bullmq/dist/esm/scripts/reprocessJob-8.js +6 -6
  298. package/dist/node_modules/bullmq/dist/esm/scripts/retryJob-11.js +47 -26
  299. package/dist/node_modules/bullmq/dist/esm/scripts/updateJobScheduler-12.d.ts +5 -0
  300. package/dist/node_modules/bullmq/dist/esm/scripts/updateJobScheduler-12.js +271 -0
  301. package/dist/node_modules/bullmq/dist/esm/scripts/updateProgress-3.js +6 -6
  302. package/dist/node_modules/bullmq/dist/esm/scripts/updateRepeatableJobMillis-1.js +1 -1
  303. package/dist/node_modules/bullmq/dist/esm/tsconfig.tsbuildinfo +1 -1
  304. package/dist/node_modules/bullmq/dist/esm/types/deduplication-options.d.ts +22 -0
  305. package/dist/node_modules/bullmq/dist/esm/types/deduplication-options.js +2 -0
  306. package/dist/node_modules/bullmq/dist/esm/types/index.d.ts +3 -0
  307. package/dist/node_modules/bullmq/dist/esm/types/index.js +3 -0
  308. package/dist/node_modules/bullmq/dist/esm/types/job-options.d.ts +19 -8
  309. package/dist/node_modules/bullmq/dist/esm/types/job-progress.d.ts +1 -0
  310. package/dist/node_modules/bullmq/dist/esm/types/job-progress.js +2 -0
  311. package/dist/node_modules/bullmq/dist/esm/types/script-queue-context.d.ts +2 -0
  312. package/dist/node_modules/bullmq/dist/esm/types/script-queue-context.js +2 -0
  313. package/dist/node_modules/bullmq/dist/esm/utils.d.ts +25 -5
  314. package/dist/node_modules/bullmq/dist/esm/utils.js +27 -0
  315. package/dist/node_modules/bullmq/dist/esm/version.d.ts +1 -1
  316. package/dist/node_modules/bullmq/dist/esm/version.js +1 -1
  317. package/dist/node_modules/bullmq/package.json +1 -1
  318. package/package.json +7 -7
  319. package/dist/node_modules/bullmq/dist/cjs/commands/addJobScheduler-2.lua +0 -91
  320. package/dist/node_modules/bullmq/dist/cjs/commands/includes/moveParentFromWaitingChildrenToFailed.lua +0 -53
  321. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKey.lua +0 -11
  322. package/dist/node_modules/bullmq/dist/cjs/commands/includes/removeDeduplicationKeyIfNeeded.lua +0 -14
  323. package/dist/node_modules/bullmq/dist/cjs/commands/moveJobFromActiveToWait-10.lua +0 -60
  324. package/dist/node_modules/bullmq/dist/cjs/commands/moveStalledJobsToWait-9.lua +0 -156
  325. package/dist/node_modules/bullmq/dist/cjs/commands/moveToWaitingChildren-5.lua +0 -68
  326. package/dist/node_modules/bullmq/dist/cjs/scripts/addJobScheduler-2.js +0 -237
  327. package/dist/node_modules/bullmq/dist/cjs/scripts/moveStalledJobsToWait-9.js +0 -529
  328. package/dist/node_modules/bullmq/dist/cjs/scripts/moveToWaitingChildren-5.js +0 -83
  329. package/dist/node_modules/bullmq/dist/esm/commands/addJobScheduler-2.lua +0 -91
  330. package/dist/node_modules/bullmq/dist/esm/commands/includes/moveParentFromWaitingChildrenToFailed.lua +0 -53
  331. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKey.lua +0 -11
  332. package/dist/node_modules/bullmq/dist/esm/commands/includes/removeDeduplicationKeyIfNeeded.lua +0 -14
  333. package/dist/node_modules/bullmq/dist/esm/commands/moveJobFromActiveToWait-10.lua +0 -60
  334. package/dist/node_modules/bullmq/dist/esm/commands/moveStalledJobsToWait-9.lua +0 -156
  335. package/dist/node_modules/bullmq/dist/esm/commands/moveToWaitingChildren-5.lua +0 -68
  336. package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.d.ts +0 -13
  337. package/dist/node_modules/bullmq/dist/esm/interfaces/debounce-options.js +0 -2
  338. package/dist/node_modules/bullmq/dist/esm/scripts/addJobScheduler-2.js +0 -234
  339. package/dist/node_modules/bullmq/dist/esm/scripts/moveStalledJobsToWait-9.js +0 -526
  340. package/dist/node_modules/bullmq/dist/esm/scripts/moveToWaitingChildren-5.js +0 -80
  341. /package/dist/node_modules/bullmq/dist/esm/scripts/{addJobScheduler-2.d.ts → addJobScheduler-11.d.ts} +0 -0
  342. /package/dist/node_modules/bullmq/dist/esm/scripts/{addParentJob-4.d.ts → addParentJob-5.d.ts} +0 -0
  343. /package/dist/node_modules/bullmq/dist/esm/scripts/{addPrioritizedJob-8.d.ts → addPrioritizedJob-9.d.ts} +0 -0
  344. /package/dist/node_modules/bullmq/dist/esm/scripts/{addStandardJob-8.d.ts → addStandardJob-9.d.ts} +0 -0
  345. /package/dist/node_modules/bullmq/dist/esm/scripts/{moveJobFromActiveToWait-10.d.ts → moveJobFromActiveToWait-9.d.ts} +0 -0
  346. /package/dist/node_modules/bullmq/dist/esm/scripts/{moveStalledJobsToWait-9.d.ts → moveStalledJobsToWait-8.d.ts} +0 -0
  347. /package/dist/node_modules/bullmq/dist/esm/scripts/{moveToWaitingChildren-5.d.ts → moveToWaitingChildren-8.d.ts} +0 -0
@@ -8,6 +8,7 @@ const content = `--[[
8
8
  KEYS[4] 'prioritized'
9
9
  KEYS[5] 'jobschedulers' (repeat)
10
10
  ARGV[1] queue key prefix
11
+ ARGV[2] should clean delayed jobs
11
12
  ]]
12
13
  local rcall = redis.call
13
14
  local queueBaseKey = ARGV[1]
@@ -15,6 +16,18 @@ local queueBaseKey = ARGV[1]
15
16
  Functions to remove jobs.
16
17
  ]]
17
18
  -- Includes
19
+ --[[
20
+ Function to filter out jobs to ignore from a table.
21
+ ]]
22
+ local function filterOutJobsToIgnore(jobs, jobsToIgnore)
23
+ local filteredJobs = {}
24
+ for i = 1, #jobs do
25
+ if not jobsToIgnore[jobs[i]] then
26
+ table.insert(filteredJobs, jobs[i])
27
+ end
28
+ end
29
+ return filteredJobs
30
+ end
18
31
  --[[
19
32
  Functions to remove jobs.
20
33
  ]]
@@ -24,21 +37,26 @@ local queueBaseKey = ARGV[1]
24
37
  ]]
25
38
  -- Includes
26
39
  --[[
27
- Function to remove deduplication key.
40
+ Function to remove deduplication key if needed
41
+ when a job is being removed.
28
42
  ]]
29
- local function removeDeduplicationKey(prefixKey, jobKey)
43
+ local function removeDeduplicationKeyIfNeededOnRemoval(prefixKey,
44
+ jobKey, jobId)
30
45
  local deduplicationId = rcall("HGET", jobKey, "deid")
31
46
  if deduplicationId then
32
47
  local deduplicationKey = prefixKey .. "de:" .. deduplicationId
33
- rcall("DEL", deduplicationKey)
48
+ local currentJobId = rcall('GET', deduplicationKey)
49
+ if currentJobId and currentJobId == jobId then
50
+ return rcall("DEL", deduplicationKey)
51
+ end
34
52
  end
35
53
  end
36
54
  --[[
37
55
  Function to remove job keys.
38
56
  ]]
39
57
  local function removeJobKeys(jobKey)
40
- return rcall("DEL", jobKey, jobKey .. ':logs',
41
- jobKey .. ':dependencies', jobKey .. ':processed', jobKey .. ':failed')
58
+ return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
59
+ jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
42
60
  end
43
61
  --[[
44
62
  Check if this job has a parent. If so we will just remove it from
@@ -92,7 +110,7 @@ local function getTargetQueueList(queueMetaKey, activeKey, waitKey, pausedKey)
92
110
  end
93
111
  return waitKey, false
94
112
  end
95
- local function moveParentToWait(parentPrefix, parentId, emitEvent)
113
+ local function _moveParentToWait(parentPrefix, parentId, emitEvent)
96
114
  local parentTarget, isPausedOrMaxed = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "active",
97
115
  parentPrefix .. "wait", parentPrefix .. "paused")
98
116
  addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPausedOrMaxed, parentId)
@@ -120,10 +138,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey, debou
120
138
  rcall("DEL", parentPrefix .. "de:" .. debounceId)
121
139
  end
122
140
  else
123
- moveParentToWait(parentPrefix, parentId)
141
+ _moveParentToWait(parentPrefix, parentId)
124
142
  end
125
143
  else
126
- moveParentToWait(parentPrefix, parentId, true)
144
+ _moveParentToWait(parentPrefix, parentId, true)
127
145
  end
128
146
  end
129
147
  end
@@ -151,10 +169,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey, debou
151
169
  rcall("DEL", parentPrefix .. "de:" .. parentAttributes[2])
152
170
  end
153
171
  else
154
- moveParentToWait(parentPrefix, parentId)
172
+ _moveParentToWait(parentPrefix, parentId)
155
173
  end
156
174
  else
157
- moveParentToWait(parentPrefix, parentId, true)
175
+ _moveParentToWait(parentPrefix, parentId, true)
158
176
  end
159
177
  end
160
178
  end
@@ -168,7 +186,7 @@ local function removeJob(jobId, hard, baseKey, shouldRemoveDeduplicationKey)
168
186
  local jobKey = baseKey .. jobId
169
187
  removeParentDependencyKey(jobKey, hard, nil, baseKey)
170
188
  if shouldRemoveDeduplicationKey then
171
- removeDeduplicationKey(baseKey, jobKey)
189
+ removeDeduplicationKeyIfNeededOnRemoval(baseKey, jobKey, jobId)
172
190
  end
173
191
  removeJobKeys(jobKey)
174
192
  end
@@ -181,8 +199,11 @@ end
181
199
  local function getListItems(keyName, max)
182
200
  return rcall('LRANGE', keyName, 0, max - 1)
183
201
  end
184
- local function removeListJobs(keyName, hard, baseKey, max)
202
+ local function removeListJobs(keyName, hard, baseKey, max, jobsToIgnore)
185
203
  local jobs = getListItems(keyName, max)
204
+ if jobsToIgnore then
205
+ jobs = filterOutJobsToIgnore(jobs, jobsToIgnore)
206
+ end
186
207
  local count = removeJobs(jobs, hard, baseKey, max)
187
208
  rcall("LTRIM", keyName, #jobs, -1)
188
209
  return count
@@ -212,15 +233,8 @@ local function getZSetItems(keyName, max)
212
233
  end
213
234
  local function removeZSetJobs(keyName, hard, baseKey, max, jobsToIgnore)
214
235
  local jobs = getZSetItems(keyName, max)
215
- -- filter out jobs to ignore
216
236
  if jobsToIgnore then
217
- local filteredJobs = {}
218
- for i = 1, #jobs do
219
- if not jobsToIgnore[jobs[i]] then
220
- table.insert(filteredJobs, jobs[i])
221
- end
222
- end
223
- jobs = filteredJobs
237
+ jobs = filterOutJobsToIgnore(jobs, jobsToIgnore)
224
238
  end
225
239
  local count = removeJobs(jobs, hard, baseKey, max)
226
240
  if(#jobs > 0) then
@@ -230,22 +244,22 @@ local function removeZSetJobs(keyName, hard, baseKey, max, jobsToIgnore)
230
244
  end
231
245
  return count
232
246
  end
233
- removeListJobs(KEYS[1], true, queueBaseKey, 0) -- wait
234
- removeListJobs(KEYS[2], true, queueBaseKey, 0) -- paused
235
- if KEYS[3] ~= "" then
236
- -- We must not remove delayed jobs if they are associated to a job scheduler.
237
- local scheduledJobs = {}
238
- local jobSchedulers = rcall("ZRANGE", KEYS[5], 0, -1, "WITHSCORES")
239
- -- For every job scheduler, get the current delayed job id.
240
- for i = 1, #jobSchedulers, 2 do
241
- local jobSchedulerId = jobSchedulers[i]
242
- local jobSchedulerMillis = jobSchedulers[i + 1]
243
- local delayedJobId = "repeat:" .. jobSchedulerId .. ":" .. jobSchedulerMillis
244
- scheduledJobs[delayedJobId] = true
245
- end
246
- removeZSetJobs(KEYS[3], true, queueBaseKey, 0, scheduledJobs) -- delayed
247
+ -- We must not remove delayed jobs if they are associated to a job scheduler.
248
+ local scheduledJobs = {}
249
+ local jobSchedulers = rcall("ZRANGE", KEYS[5], 0, -1, "WITHSCORES")
250
+ -- For every job scheduler, get the current delayed job id.
251
+ for i = 1, #jobSchedulers, 2 do
252
+ local jobSchedulerId = jobSchedulers[i]
253
+ local jobSchedulerMillis = jobSchedulers[i + 1]
254
+ local delayedJobId = "repeat:" .. jobSchedulerId .. ":" .. jobSchedulerMillis
255
+ scheduledJobs[delayedJobId] = true
256
+ end
257
+ removeListJobs(KEYS[1], true, queueBaseKey, 0, scheduledJobs) -- wait
258
+ removeListJobs(KEYS[2], true, queueBaseKey, 0, scheduledJobs) -- paused
259
+ if ARGV[2] == "1" then
260
+ removeZSetJobs(KEYS[3], true, queueBaseKey, 0, scheduledJobs) -- delayed
247
261
  end
248
- removeZSetJobs(KEYS[4], true, queueBaseKey, 0) -- prioritized
262
+ removeZSetJobs(KEYS[4], true, queueBaseKey, 0, scheduledJobs) -- prioritized
249
263
  `;
250
264
  export const drain = {
251
265
  name: 'drain',
@@ -0,0 +1,5 @@
1
+ export declare const getDependencyCounts: {
2
+ name: string;
3
+ content: string;
4
+ keys: number;
5
+ };
@@ -0,0 +1,34 @@
1
+ const content = `--[[
2
+ Get counts per child states
3
+ Input:
4
+ KEYS[1] processed key
5
+ KEYS[2] unprocessed key
6
+ KEYS[3] ignored key
7
+ KEYS[4] failed key
8
+ ARGV[1...] types
9
+ ]]
10
+ local rcall = redis.call;
11
+ local processedKey = KEYS[1]
12
+ local unprocessedKey = KEYS[2]
13
+ local ignoredKey = KEYS[3]
14
+ local failedKey = KEYS[4]
15
+ local results = {}
16
+ for i = 1, #ARGV do
17
+ if ARGV[i] == "processed" then
18
+ results[#results+1] = rcall("HLEN", processedKey)
19
+ elseif ARGV[i] == "unprocessed" then
20
+ results[#results+1] = rcall("SCARD", unprocessedKey)
21
+ elseif ARGV[i] == "ignored" then
22
+ results[#results+1] = rcall("HLEN", ignoredKey)
23
+ else
24
+ results[#results+1] = rcall("ZCARD", failedKey)
25
+ end
26
+ end
27
+ return results
28
+ `;
29
+ export const getDependencyCounts = {
30
+ name: 'getDependencyCounts',
31
+ content,
32
+ keys: 4,
33
+ };
34
+ //# sourceMappingURL=getDependencyCounts-4.js.map
@@ -21,16 +21,16 @@ const content = `--[[
21
21
  'unknown'
22
22
  ]]
23
23
  local rcall = redis.call
24
- if rcall("ZSCORE", KEYS[1], ARGV[1]) ~= false then
24
+ if rcall("ZSCORE", KEYS[1], ARGV[1]) then
25
25
  return "completed"
26
26
  end
27
- if rcall("ZSCORE", KEYS[2], ARGV[1]) ~= false then
27
+ if rcall("ZSCORE", KEYS[2], ARGV[1]) then
28
28
  return "failed"
29
29
  end
30
- if rcall("ZSCORE", KEYS[3], ARGV[1]) ~= false then
30
+ if rcall("ZSCORE", KEYS[3], ARGV[1]) then
31
31
  return "delayed"
32
32
  end
33
- if rcall("ZSCORE", KEYS[8], ARGV[1]) ~= false then
33
+ if rcall("ZSCORE", KEYS[8], ARGV[1]) then
34
34
  return "prioritized"
35
35
  end
36
36
  -- Includes
@@ -57,7 +57,7 @@ local paused_items = rcall("LRANGE", KEYS[6] , 0, -1)
57
57
  if checkItemInList(paused_items, ARGV[1]) ~= nil then
58
58
  return "waiting"
59
59
  end
60
- if rcall("ZSCORE", KEYS[7], ARGV[1]) ~= false then
60
+ if rcall("ZSCORE", KEYS[7], ARGV[1]) then
61
61
  return "waiting-children"
62
62
  end
63
63
  return "unknown"
@@ -20,28 +20,28 @@ const content = `--[[
20
20
  'unknown'
21
21
  ]]
22
22
  local rcall = redis.call
23
- if rcall("ZSCORE", KEYS[1], ARGV[1]) ~= false then
23
+ if rcall("ZSCORE", KEYS[1], ARGV[1]) then
24
24
  return "completed"
25
25
  end
26
- if rcall("ZSCORE", KEYS[2], ARGV[1]) ~= false then
26
+ if rcall("ZSCORE", KEYS[2], ARGV[1]) then
27
27
  return "failed"
28
28
  end
29
- if rcall("ZSCORE", KEYS[3], ARGV[1]) ~= false then
29
+ if rcall("ZSCORE", KEYS[3], ARGV[1]) then
30
30
  return "delayed"
31
31
  end
32
- if rcall("ZSCORE", KEYS[8], ARGV[1]) ~= false then
32
+ if rcall("ZSCORE", KEYS[8], ARGV[1]) then
33
33
  return "prioritized"
34
34
  end
35
- if rcall("LPOS", KEYS[4] , ARGV[1]) ~= false then
35
+ if rcall("LPOS", KEYS[4] , ARGV[1]) then
36
36
  return "active"
37
37
  end
38
- if rcall("LPOS", KEYS[5] , ARGV[1]) ~= false then
38
+ if rcall("LPOS", KEYS[5] , ARGV[1]) then
39
39
  return "waiting"
40
40
  end
41
- if rcall("LPOS", KEYS[6] , ARGV[1]) ~= false then
41
+ if rcall("LPOS", KEYS[6] , ARGV[1]) then
42
42
  return "waiting"
43
43
  end
44
- if rcall("ZSCORE", KEYS[7] , ARGV[1]) ~= false then
44
+ if rcall("ZSCORE", KEYS[7] , ARGV[1]) then
45
45
  return "waiting-children"
46
46
  end
47
47
  return "unknown"
@@ -1,10 +1,10 @@
1
1
  export * from './addDelayedJob-6';
2
- export * from './addJobScheduler-2';
2
+ export * from './addJobScheduler-11';
3
3
  export * from './addLog-2';
4
- export * from './addParentJob-4';
5
- export * from './addPrioritizedJob-8';
4
+ export * from './addParentJob-5';
5
+ export * from './addPrioritizedJob-9';
6
6
  export * from './addRepeatableJob-2';
7
- export * from './addStandardJob-8';
7
+ export * from './addStandardJob-9';
8
8
  export * from './changeDelay-4';
9
9
  export * from './changePriority-7';
10
10
  export * from './cleanJobsInSet-3';
@@ -13,6 +13,7 @@ export * from './extendLock-2';
13
13
  export * from './extendLocks-1';
14
14
  export * from './getCounts-1';
15
15
  export * from './getCountsPerPriority-4';
16
+ export * from './getDependencyCounts-4';
16
17
  export * from './getJobScheduler-1';
17
18
  export * from './getRanges-1';
18
19
  export * from './getRateLimitTtl-1';
@@ -21,13 +22,13 @@ export * from './getStateV2-8';
21
22
  export * from './isFinished-3';
22
23
  export * from './isJobInList-1';
23
24
  export * from './isMaxed-2';
24
- export * from './moveJobFromActiveToWait-10';
25
+ export * from './moveJobFromActiveToWait-9';
25
26
  export * from './moveJobsToWait-8';
26
- export * from './moveStalledJobsToWait-9';
27
+ export * from './moveStalledJobsToWait-8';
27
28
  export * from './moveToActive-11';
28
29
  export * from './moveToDelayed-8';
29
30
  export * from './moveToFinished-14';
30
- export * from './moveToWaitingChildren-5';
31
+ export * from './moveToWaitingChildren-8';
31
32
  export * from './obliterate-2';
32
33
  export * from './paginate-1';
33
34
  export * from './pause-7';
@@ -37,9 +38,11 @@ export * from './removeChildDependency-1';
37
38
  export * from './removeJob-2';
38
39
  export * from './removeJobScheduler-3';
39
40
  export * from './removeRepeatable-3';
41
+ export * from './removeUnprocessedChildren-2';
40
42
  export * from './reprocessJob-8';
41
43
  export * from './retryJob-11';
42
44
  export * from './saveStacktrace-1';
43
45
  export * from './updateData-1';
46
+ export * from './updateJobScheduler-12';
44
47
  export * from './updateProgress-3';
45
48
  export * from './updateRepeatableJobMillis-1';
@@ -1,10 +1,10 @@
1
1
  export * from './addDelayedJob-6';
2
- export * from './addJobScheduler-2';
2
+ export * from './addJobScheduler-11';
3
3
  export * from './addLog-2';
4
- export * from './addParentJob-4';
5
- export * from './addPrioritizedJob-8';
4
+ export * from './addParentJob-5';
5
+ export * from './addPrioritizedJob-9';
6
6
  export * from './addRepeatableJob-2';
7
- export * from './addStandardJob-8';
7
+ export * from './addStandardJob-9';
8
8
  export * from './changeDelay-4';
9
9
  export * from './changePriority-7';
10
10
  export * from './cleanJobsInSet-3';
@@ -13,6 +13,7 @@ export * from './extendLock-2';
13
13
  export * from './extendLocks-1';
14
14
  export * from './getCounts-1';
15
15
  export * from './getCountsPerPriority-4';
16
+ export * from './getDependencyCounts-4';
16
17
  export * from './getJobScheduler-1';
17
18
  export * from './getRanges-1';
18
19
  export * from './getRateLimitTtl-1';
@@ -21,13 +22,13 @@ export * from './getStateV2-8';
21
22
  export * from './isFinished-3';
22
23
  export * from './isJobInList-1';
23
24
  export * from './isMaxed-2';
24
- export * from './moveJobFromActiveToWait-10';
25
+ export * from './moveJobFromActiveToWait-9';
25
26
  export * from './moveJobsToWait-8';
26
- export * from './moveStalledJobsToWait-9';
27
+ export * from './moveStalledJobsToWait-8';
27
28
  export * from './moveToActive-11';
28
29
  export * from './moveToDelayed-8';
29
30
  export * from './moveToFinished-14';
30
- export * from './moveToWaitingChildren-5';
31
+ export * from './moveToWaitingChildren-8';
31
32
  export * from './obliterate-2';
32
33
  export * from './paginate-1';
33
34
  export * from './pause-7';
@@ -37,10 +38,12 @@ export * from './removeChildDependency-1';
37
38
  export * from './removeJob-2';
38
39
  export * from './removeJobScheduler-3';
39
40
  export * from './removeRepeatable-3';
41
+ export * from './removeUnprocessedChildren-2';
40
42
  export * from './reprocessJob-8';
41
43
  export * from './retryJob-11';
42
44
  export * from './saveStacktrace-1';
43
45
  export * from './updateData-1';
46
+ export * from './updateJobScheduler-12';
44
47
  export * from './updateProgress-3';
45
48
  export * from './updateRepeatableJobMillis-1';
46
49
  //# sourceMappingURL=index.js.map
@@ -19,14 +19,14 @@ if rcall("EXISTS", KEYS[3]) ~= 1 then
19
19
  end
20
20
  return -1
21
21
  end
22
- if rcall("ZSCORE", KEYS[1], ARGV[1]) ~= false then
22
+ if rcall("ZSCORE", KEYS[1], ARGV[1]) then
23
23
  if ARGV[2] == "1" then
24
24
  local returnValue = rcall("HGET", KEYS[3], "returnvalue")
25
25
  return {1,returnValue}
26
26
  end
27
27
  return 1
28
28
  end
29
- if rcall("ZSCORE", KEYS[2], ARGV[1]) ~= false then
29
+ if rcall("ZSCORE", KEYS[2], ARGV[1]) then
30
30
  if ARGV[2] == "1" then
31
31
  local failedReason = rcall("HGET", KEYS[3], "failedReason")
32
32
  return {2,failedReason}
@@ -4,13 +4,12 @@ const content = `--[[
4
4
  KEYS[1] active key
5
5
  KEYS[2] wait key
6
6
  KEYS[3] stalled key
7
- KEYS[4] job lock key
8
- KEYS[5] paused key
9
- KEYS[6] meta key
10
- KEYS[7] limiter key
11
- KEYS[8] prioritized key
12
- KEYS[9] marker key
13
- KEYS[10] event key
7
+ KEYS[4] paused key
8
+ KEYS[5] meta key
9
+ KEYS[6] limiter key
10
+ KEYS[7] prioritized key
11
+ KEYS[8] marker key
12
+ KEYS[9] event key
14
13
  ARGV[1] job id
15
14
  ARGV[2] lock token
16
15
  ARGV[3] job id key
@@ -46,12 +45,12 @@ end
46
45
  Function to get max events value or set by default 10000.
47
46
  ]]
48
47
  local function getOrSetMaxEvents(metaKey)
49
- local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
50
- if not maxEvents then
51
- maxEvents = 10000
52
- rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
53
- end
54
- return maxEvents
48
+ local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
49
+ if not maxEvents then
50
+ maxEvents = 10000
51
+ rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
52
+ end
53
+ return maxEvents
55
54
  end
56
55
  --[[
57
56
  Function to check for the meta.paused key to decide if we are paused or not
@@ -73,35 +72,56 @@ local function getTargetQueueList(queueMetaKey, activeKey, waitKey, pausedKey)
73
72
  end
74
73
  return waitKey, false
75
74
  end
76
- local jobId = ARGV[1]
77
- local token = ARGV[2]
78
- local lockKey = KEYS[4]
79
- local lockToken = rcall("GET", lockKey)
80
- local pttl = rcall("PTTL", KEYS[7])
81
- if lockToken == token then
82
- local metaKey = KEYS[6]
83
- local removed = rcall("LREM", KEYS[1], 1, jobId)
84
- if removed > 0 then
85
- local target, isPausedOrMaxed = getTargetQueueList(metaKey, KEYS[1], KEYS[2], KEYS[5])
86
- rcall("SREM", KEYS[3], jobId)
87
- local priority = tonumber(rcall("HGET", ARGV[3], "priority")) or 0
88
- if priority > 0 then
89
- pushBackJobWithPriority(KEYS[8], priority, jobId)
75
+ local function removeLock(jobKey, stalledKey, token, jobId)
76
+ if token ~= "0" then
77
+ local lockKey = jobKey .. ':lock'
78
+ local lockToken = rcall("GET", lockKey)
79
+ if lockToken == token then
80
+ rcall("DEL", lockKey)
81
+ rcall("SREM", stalledKey, jobId)
90
82
  else
91
- addJobInTargetList(target, KEYS[9], "RPUSH", isPausedOrMaxed, jobId)
83
+ if lockToken then
84
+ -- Lock exists but token does not match
85
+ return -6
86
+ else
87
+ -- Lock is missing completely
88
+ return -2
89
+ end
92
90
  end
93
- rcall("DEL", lockKey)
94
- local maxEvents = getOrSetMaxEvents(metaKey)
95
- -- Emit waiting event
96
- rcall("XADD", KEYS[10], "MAXLEN", "~", maxEvents, "*", "event", "waiting",
97
- "jobId", jobId)
98
91
  end
92
+ return 0
93
+ end
94
+ local jobId = ARGV[1]
95
+ local token = ARGV[2]
96
+ local jobKey = ARGV[3]
97
+ local errorCode = removeLock(jobKey, KEYS[3], token, jobId)
98
+ if errorCode < 0 then
99
+ return errorCode
100
+ end
101
+ local metaKey = KEYS[5]
102
+ local removed = rcall("LREM", KEYS[1], 1, jobId)
103
+ if removed > 0 then
104
+ local target, isPausedOrMaxed = getTargetQueueList(metaKey, KEYS[1], KEYS[2], KEYS[4])
105
+ local priority = tonumber(rcall("HGET", ARGV[3], "priority")) or 0
106
+ if priority > 0 then
107
+ pushBackJobWithPriority(KEYS[7], priority, jobId)
108
+ else
109
+ addJobInTargetList(target, KEYS[8], "RPUSH", isPausedOrMaxed, jobId)
110
+ end
111
+ local maxEvents = getOrSetMaxEvents(metaKey)
112
+ -- Emit waiting event
113
+ rcall("XADD", KEYS[9], "MAXLEN", "~", maxEvents, "*", "event", "waiting",
114
+ "jobId", jobId, "prev", "active")
99
115
  end
100
- return pttl
101
- `;
116
+ local pttl = rcall("PTTL", KEYS[6])
117
+ if pttl > 0 then
118
+ return pttl
119
+ else
120
+ return 0
121
+ end`;
102
122
  export const moveJobFromActiveToWait = {
103
123
  name: 'moveJobFromActiveToWait',
104
124
  content,
105
- keys: 10,
125
+ keys: 9,
106
126
  };
107
- //# sourceMappingURL=moveJobFromActiveToWait-10.js.map
127
+ //# sourceMappingURL=moveJobFromActiveToWait-9.js.map
@@ -49,12 +49,12 @@ end
49
49
  Function to get max events value or set by default 10000.
50
50
  ]]
51
51
  local function getOrSetMaxEvents(metaKey)
52
- local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
53
- if not maxEvents then
54
- maxEvents = 10000
55
- rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
56
- end
57
- return maxEvents
52
+ local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
53
+ if not maxEvents then
54
+ maxEvents = 10000
55
+ rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
56
+ end
57
+ return maxEvents
58
58
  end
59
59
  --[[
60
60
  Function to check for the meta.paused key to decide if we are paused or not