sidekiq-unique-jobs 6.0.7 → 7.1.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1880 -156
  3. data/README.md +818 -238
  4. data/bin/uniquejobs +2 -2
  5. data/lib/sidekiq-unique-jobs.rb +1 -1
  6. data/lib/sidekiq_unique_jobs/batch_delete.rb +124 -0
  7. data/lib/sidekiq_unique_jobs/changelog.rb +78 -0
  8. data/lib/sidekiq_unique_jobs/cli.rb +68 -25
  9. data/lib/sidekiq_unique_jobs/config.rb +319 -0
  10. data/lib/sidekiq_unique_jobs/connection.rb +6 -5
  11. data/lib/sidekiq_unique_jobs/constants.rb +50 -20
  12. data/lib/sidekiq_unique_jobs/core_ext.rb +80 -0
  13. data/lib/sidekiq_unique_jobs/deprecation.rb +65 -0
  14. data/lib/sidekiq_unique_jobs/digests.rb +70 -87
  15. data/lib/sidekiq_unique_jobs/exceptions.rb +88 -12
  16. data/lib/sidekiq_unique_jobs/expiring_digests.rb +14 -0
  17. data/lib/sidekiq_unique_jobs/job.rb +47 -13
  18. data/lib/sidekiq_unique_jobs/json.rb +47 -0
  19. data/lib/sidekiq_unique_jobs/key.rb +98 -0
  20. data/lib/sidekiq_unique_jobs/lock/base_lock.rb +111 -82
  21. data/lib/sidekiq_unique_jobs/lock/client_validator.rb +28 -0
  22. data/lib/sidekiq_unique_jobs/lock/server_validator.rb +27 -0
  23. data/lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb +45 -5
  24. data/lib/sidekiq_unique_jobs/lock/until_executed.rb +30 -4
  25. data/lib/sidekiq_unique_jobs/lock/until_executing.rb +26 -2
  26. data/lib/sidekiq_unique_jobs/lock/until_expired.rb +27 -15
  27. data/lib/sidekiq_unique_jobs/lock/validator.rb +96 -0
  28. data/lib/sidekiq_unique_jobs/lock/while_executing.rb +26 -7
  29. data/lib/sidekiq_unique_jobs/lock/while_executing_reject.rb +3 -11
  30. data/lib/sidekiq_unique_jobs/lock.rb +342 -0
  31. data/lib/sidekiq_unique_jobs/lock_args.rb +127 -0
  32. data/lib/sidekiq_unique_jobs/lock_config.rb +126 -0
  33. data/lib/sidekiq_unique_jobs/lock_digest.rb +79 -0
  34. data/lib/sidekiq_unique_jobs/lock_info.rb +68 -0
  35. data/lib/sidekiq_unique_jobs/lock_timeout.rb +62 -0
  36. data/lib/sidekiq_unique_jobs/lock_ttl.rb +77 -0
  37. data/lib/sidekiq_unique_jobs/lock_type.rb +37 -0
  38. data/lib/sidekiq_unique_jobs/locksmith.rb +324 -95
  39. data/lib/sidekiq_unique_jobs/logging/middleware_context.rb +44 -0
  40. data/lib/sidekiq_unique_jobs/logging.rb +208 -30
  41. data/lib/sidekiq_unique_jobs/lua/delete.lua +51 -0
  42. data/lib/sidekiq_unique_jobs/lua/delete_by_digest.lua +42 -0
  43. data/lib/sidekiq_unique_jobs/lua/delete_job_by_digest.lua +38 -0
  44. data/lib/sidekiq_unique_jobs/lua/find_digest_in_queues.lua +26 -0
  45. data/lib/sidekiq_unique_jobs/lua/lock.lua +99 -0
  46. data/lib/sidekiq_unique_jobs/lua/lock_until_expired.lua +92 -0
  47. data/lib/sidekiq_unique_jobs/lua/locked.lua +35 -0
  48. data/lib/sidekiq_unique_jobs/lua/queue.lua +87 -0
  49. data/lib/sidekiq_unique_jobs/lua/reap_orphans.lua +122 -0
  50. data/lib/sidekiq_unique_jobs/lua/shared/_common.lua +40 -0
  51. data/lib/sidekiq_unique_jobs/lua/shared/_current_time.lua +8 -0
  52. data/lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua +22 -0
  53. data/lib/sidekiq_unique_jobs/lua/shared/_delete_from_sorted_set.lua +18 -0
  54. data/lib/sidekiq_unique_jobs/lua/shared/_find_digest_in_process_set.lua +53 -0
  55. data/lib/sidekiq_unique_jobs/lua/shared/_find_digest_in_queues.lua +43 -0
  56. data/lib/sidekiq_unique_jobs/lua/shared/_find_digest_in_sorted_set.lua +24 -0
  57. data/lib/sidekiq_unique_jobs/lua/shared/_hgetall.lua +13 -0
  58. data/lib/sidekiq_unique_jobs/lua/shared/_upgrades.lua +3 -0
  59. data/lib/sidekiq_unique_jobs/lua/unlock.lua +107 -0
  60. data/lib/sidekiq_unique_jobs/lua/update_version.lua +40 -0
  61. data/lib/sidekiq_unique_jobs/lua/upgrade.lua +68 -0
  62. data/lib/sidekiq_unique_jobs/middleware/client.rb +42 -0
  63. data/lib/sidekiq_unique_jobs/middleware/server.rb +31 -0
  64. data/lib/sidekiq_unique_jobs/middleware.rb +33 -30
  65. data/lib/sidekiq_unique_jobs/normalizer.rb +4 -4
  66. data/lib/sidekiq_unique_jobs/on_conflict/log.rb +9 -5
  67. data/lib/sidekiq_unique_jobs/on_conflict/null_strategy.rb +1 -1
  68. data/lib/sidekiq_unique_jobs/on_conflict/raise.rb +2 -2
  69. data/lib/sidekiq_unique_jobs/on_conflict/reject.rb +63 -17
  70. data/lib/sidekiq_unique_jobs/on_conflict/replace.rb +54 -14
  71. data/lib/sidekiq_unique_jobs/on_conflict/reschedule.rb +16 -5
  72. data/lib/sidekiq_unique_jobs/on_conflict/strategy.rb +26 -7
  73. data/lib/sidekiq_unique_jobs/on_conflict.rb +34 -16
  74. data/lib/sidekiq_unique_jobs/options_with_fallback.rb +39 -36
  75. data/lib/sidekiq_unique_jobs/orphans/lua_reaper.rb +29 -0
  76. data/lib/sidekiq_unique_jobs/orphans/manager.rb +241 -0
  77. data/lib/sidekiq_unique_jobs/orphans/null_reaper.rb +24 -0
  78. data/lib/sidekiq_unique_jobs/orphans/observer.rb +42 -0
  79. data/lib/sidekiq_unique_jobs/orphans/reaper.rb +114 -0
  80. data/lib/sidekiq_unique_jobs/orphans/reaper_resurrector.rb +170 -0
  81. data/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb +298 -0
  82. data/lib/sidekiq_unique_jobs/redis/entity.rb +112 -0
  83. data/lib/sidekiq_unique_jobs/redis/hash.rb +56 -0
  84. data/lib/sidekiq_unique_jobs/redis/list.rb +32 -0
  85. data/lib/sidekiq_unique_jobs/redis/set.rb +32 -0
  86. data/lib/sidekiq_unique_jobs/redis/sorted_set.rb +86 -0
  87. data/lib/sidekiq_unique_jobs/redis/string.rb +51 -0
  88. data/lib/sidekiq_unique_jobs/redis.rb +11 -0
  89. data/lib/sidekiq_unique_jobs/reflectable.rb +26 -0
  90. data/lib/sidekiq_unique_jobs/reflections.rb +79 -0
  91. data/lib/sidekiq_unique_jobs/rspec/matchers/have_valid_sidekiq_options.rb +51 -0
  92. data/lib/sidekiq_unique_jobs/rspec/matchers.rb +26 -0
  93. data/lib/sidekiq_unique_jobs/script/caller.rb +127 -0
  94. data/lib/sidekiq_unique_jobs/script.rb +15 -0
  95. data/lib/sidekiq_unique_jobs/server.rb +61 -0
  96. data/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb +115 -66
  97. data/lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb +304 -0
  98. data/lib/sidekiq_unique_jobs/sidekiq_worker_methods.rb +51 -29
  99. data/lib/sidekiq_unique_jobs/testing.rb +104 -31
  100. data/lib/sidekiq_unique_jobs/timer_task.rb +299 -0
  101. data/lib/sidekiq_unique_jobs/timing.rb +58 -0
  102. data/lib/sidekiq_unique_jobs/unlockable.rb +20 -4
  103. data/lib/sidekiq_unique_jobs/update_version.rb +25 -0
  104. data/lib/sidekiq_unique_jobs/upgrade_locks.rb +155 -0
  105. data/lib/sidekiq_unique_jobs/version.rb +3 -1
  106. data/lib/sidekiq_unique_jobs/version_check.rb +114 -0
  107. data/lib/sidekiq_unique_jobs/web/helpers.rb +140 -15
  108. data/lib/sidekiq_unique_jobs/web/views/_paging.erb +4 -4
  109. data/lib/sidekiq_unique_jobs/web/views/changelogs.erb +54 -0
  110. data/lib/sidekiq_unique_jobs/web/views/lock.erb +110 -0
  111. data/lib/sidekiq_unique_jobs/web/views/locks.erb +54 -0
  112. data/lib/sidekiq_unique_jobs/web.rb +86 -29
  113. data/lib/sidekiq_unique_jobs.rb +78 -105
  114. data/lib/tasks/changelog.rake +23 -0
  115. metadata +154 -218
  116. data/.codeclimate.yml +0 -35
  117. data/.csslintrc +0 -2
  118. data/.dockerignore +0 -4
  119. data/.editorconfig +0 -14
  120. data/.eslintignore +0 -1
  121. data/.eslintrc +0 -213
  122. data/.fasterer.yml +0 -23
  123. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
  124. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
  125. data/.gitignore +0 -28
  126. data/.reek.yml +0 -87
  127. data/.rspec +0 -2
  128. data/.rubocop.yml +0 -127
  129. data/.simplecov +0 -20
  130. data/.travis.yml +0 -47
  131. data/.yardopts +0 -7
  132. data/Appraisals +0 -29
  133. data/CODE_OF_CONDUCT.md +0 -74
  134. data/Gemfile +0 -24
  135. data/Guardfile +0 -55
  136. data/Rakefile +0 -12
  137. data/_config.yml +0 -1
  138. data/assets/unique_digests_1.png +0 -0
  139. data/assets/unique_digests_2.png +0 -0
  140. data/bin/bench +0 -20
  141. data/examples/another_unique_job.rb +0 -15
  142. data/examples/custom_queue_job.rb +0 -12
  143. data/examples/custom_queue_job_with_filter_method.rb +0 -13
  144. data/examples/custom_queue_job_with_filter_proc.rb +0 -16
  145. data/examples/expiring_job.rb +0 -12
  146. data/examples/inline_worker.rb +0 -12
  147. data/examples/just_a_worker.rb +0 -13
  148. data/examples/long_running_job.rb +0 -14
  149. data/examples/main_job.rb +0 -14
  150. data/examples/my_job.rb +0 -12
  151. data/examples/my_unique_job.rb +0 -15
  152. data/examples/my_unique_job_with_filter_method.rb +0 -21
  153. data/examples/my_unique_job_with_filter_proc.rb +0 -19
  154. data/examples/notify_worker.rb +0 -14
  155. data/examples/plain_class.rb +0 -13
  156. data/examples/simple_worker.rb +0 -15
  157. data/examples/spawn_simple_worker.rb +0 -12
  158. data/examples/test_class.rb +0 -9
  159. data/examples/unique_across_workers_job.rb +0 -20
  160. data/examples/unique_job_on_conflict_raise.rb +0 -14
  161. data/examples/unique_job_on_conflict_reject.rb +0 -14
  162. data/examples/unique_job_on_conflict_reschedule.rb +0 -14
  163. data/examples/unique_job_with_conditional_parameter.rb +0 -18
  164. data/examples/unique_job_with_filter_method.rb +0 -21
  165. data/examples/unique_job_with_nil_unique_args.rb +0 -20
  166. data/examples/unique_job_with_no_unique_args_method.rb +0 -16
  167. data/examples/unique_job_withthout_unique_args_parameter.rb +0 -18
  168. data/examples/unique_on_all_queues_job.rb +0 -16
  169. data/examples/until_and_while_executing_job.rb +0 -17
  170. data/examples/until_executed_2_job.rb +0 -24
  171. data/examples/until_executed_job.rb +0 -25
  172. data/examples/until_executing_job.rb +0 -11
  173. data/examples/until_expired_job.rb +0 -12
  174. data/examples/until_global_expired_job.rb +0 -12
  175. data/examples/while_executing_job.rb +0 -15
  176. data/examples/while_executing_reject_job.rb +0 -14
  177. data/examples/without_argument_job.rb +0 -13
  178. data/lib/sidekiq_unique_jobs/client/middleware.rb +0 -56
  179. data/lib/sidekiq_unique_jobs/scripts.rb +0 -89
  180. data/lib/sidekiq_unique_jobs/server/middleware.rb +0 -40
  181. data/lib/sidekiq_unique_jobs/timeout/calculator.rb +0 -63
  182. data/lib/sidekiq_unique_jobs/timeout.rb +0 -8
  183. data/lib/sidekiq_unique_jobs/unique_args.rb +0 -149
  184. data/lib/sidekiq_unique_jobs/util.rb +0 -103
  185. data/lib/sidekiq_unique_jobs/web/views/unique_digest.erb +0 -28
  186. data/lib/sidekiq_unique_jobs/web/views/unique_digests.erb +0 -42
  187. data/redis/acquire_lock.lua +0 -21
  188. data/redis/delete.lua +0 -14
  189. data/redis/delete_by_digest.lua +0 -24
  190. data/redis/delete_job_by_digest.lua +0 -60
  191. data/redis/lock.lua +0 -58
  192. data/redis/release_stale_locks.lua +0 -90
  193. data/redis/unlock.lua +0 -32
  194. data/sidekiq-unique-jobs.gemspec +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10e850f31b0ccdb3fb851cd075ab25ff6121245c7b0eace83e7075b637bbccf2
4
- data.tar.gz: 6b6d7592acd4822c915b54c29d4fde9715709edbececdd7ff3324401ce8cfb8c
3
+ metadata.gz: 02bb9ffa139a253d74b8311952767e72cf48499d8071342d433fcd1d185f31c7
4
+ data.tar.gz: 2550ac532b5dd0ec61b70bababa532acbf35851ba34f888ba4269c88d95fdce2
5
5
  SHA512:
6
- metadata.gz: c68d91eaa41ab900ab2063a1a7f514283743f11546fff0ba479869c4479c8ff2ccb1b4d04636dcc6bb8f9dd8345562a09c488380dcadd5e1d1fb745eb5ec3564
7
- data.tar.gz: a36b53f36718f17e2ab4f25d5456aae403e51a53cecdacd142c26dc28c177f147bce6c960db8b9ce31328c621ab0379251e27b0fed9b0de04d3175e23d8134e3
6
+ metadata.gz: 0c45478c4da0ef2150fab5684e2817bbbdd61ef6a8f87cdc74cf7e80c84779d9bf425c872e783ff5356133cb416c9313736e5a5a3a6782cc5f610bbfcc2769f2
7
+ data.tar.gz: d9beeeae13dd13612ac422257f501a9da5c16229b9b67706784ef3479a7c7c8faf329710683548e21070e9b8860e0b66920969a08b129c0600a87354205ca806