sidekiq-unique-jobs 7.0.0.beta24 → 7.0.0.beta25

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq-unique-jobs might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbd7bb8a58fe7319fb013de48e8c3914bb66157bb447b7186adaa9e936d1975e
4
- data.tar.gz: 79e21055189827adeb3e8dadffe4ad86b75c464e5261731532e599278c3a154e
3
+ metadata.gz: 616316456566100190d005a5173bd3e9aa0f5558182d9e5e9965ecffde4aea65
4
+ data.tar.gz: bc35728df95960b932af55737c358df8d3a18a0d5c9798d944f0f386113a35d0
5
5
  SHA512:
6
- metadata.gz: 83bdc216d7b13aefc6cb168a175e6fda8974ae9fbbe356505889b20f1ed358b297d4fbe1fd8cb67ad5e393a332db764b81d58a9978508fd7cfe6ce0b83f49ff3
7
- data.tar.gz: ea3b0d0681a700f434b4204ddad09374b22375365c4bf7532a5a56fe70b9e08d1a4a6bcc38dfae2f91efb60d00553a13c942e0737b5fb1b1fc0124f38c1f9c2b
6
+ metadata.gz: 9d3a8b690a6599d7ad0d4a9dc249aa32ab193efb41fcb4ab37825f2921376af863e8949f51341e1fccb97628213d4aa0dd215d6442c030771593b7ad9f99cc2e
7
+ data.tar.gz: 2a25c29067a417bdc244dfecfc9777d8c195edc98ede3367be7a93d364191f30cdd012056fe70570739e45122a9ba6d7b2a8247b5ea414b238aa7eaa1d561d33
@@ -1,12 +1,34 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/HEAD)
3
+ ## [v7.0.0.beta24](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta24) (2020-09-27)
4
4
 
5
- [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta22...HEAD)
5
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta23...v7.0.0.beta24)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Support both instance method and class method [\#527](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/527) ([mhenrixon](https://github.com/mhenrixon))
6
10
 
7
11
  **Closed issues:**
8
12
 
13
+ - while\_executing + raise let non-unique jobs to be executed [\#534](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/534)
14
+ - Leaked keys in version 5.0.10 [\#519](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/519)
15
+
16
+ ## [v7.0.0.beta23](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta23) (2020-06-23)
17
+
18
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.23...v7.0.0.beta23)
19
+
20
+ **Fixed bugs:**
21
+
22
+ - Exit early when no results are returned from LRANGE given jobs might already processed [\#521](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/521) ([vipulnsward](https://github.com/vipulnsward))
23
+
24
+ ## [v6.0.23](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.23) (2020-06-23)
25
+
26
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta22...v6.0.23)
27
+
28
+ **Fixed bugs:**
29
+
9
30
  - Ruby reaper incorrectly checks active jobs — removes every active lock as result [\#517](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/517)
31
+ - Backport \#465 to 6.x series [\#520](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/520) ([replaid](https://github.com/replaid))
10
32
 
11
33
  ## [v7.0.0.beta22](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta22) (2020-06-12)
12
34
 
@@ -417,7 +439,7 @@
417
439
  **Closed issues:**
418
440
 
419
441
  - Unique args in combination with sidekiq cron contains `\_aj\_symbol\_keys` [\#363](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/363)
420
- - Low quality peace of shit [\#360](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/360)
442
+ - Low quality piece of shit [\#360](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/360)
421
443
  - Passthrough has been deprecated and will be removed in redis-namespace 2.0 [\#338](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/338)
422
444
 
423
445
  ## [v6.0.12](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.12) (2019-02-28)
@@ -640,7 +662,6 @@
640
662
 
641
663
  **Merged pull requests:**
642
664
 
643
- - Add more details about testing uniqueness [\#301](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/301) ([mhenrixon](https://github.com/mhenrixon))
644
665
  - Update README.md [\#300](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/300) ([pirj](https://github.com/pirj))
645
666
 
646
667
  ## [v6.0.0.rc7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc7) (2018-07-23)
@@ -660,6 +681,7 @@
660
681
 
661
682
  **Merged pull requests:**
662
683
 
684
+ - Add more details about testing uniqueness [\#301](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/301) ([mhenrixon](https://github.com/mhenrixon))
663
685
  - Adds changelog entry [\#299](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/299) ([mhenrixon](https://github.com/mhenrixon))
664
686
  - Fix README [\#298](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/298) ([mhenrixon](https://github.com/mhenrixon))
665
687
 
@@ -695,6 +717,7 @@
695
717
  **Implemented enhancements:**
696
718
 
697
719
  - Prepare for v6 [\#286](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/286) ([mhenrixon](https://github.com/mhenrixon))
720
+ - Only unlock not delete [\#285](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/285) ([mhenrixon](https://github.com/mhenrixon))
698
721
 
699
722
  ## [v6.0.0.rc3](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc3) (2018-06-29)
700
723
 
@@ -712,7 +735,6 @@
712
735
 
713
736
  - Within tests: workers enqueued in the future don't clear their unique locks after being drained/executed [\#254](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/254)
714
737
  - Unexpected behavior with until\_executed [\#250](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/250)
715
- - Only unlock not delete [\#285](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/285) ([mhenrixon](https://github.com/mhenrixon))
716
738
 
717
739
  **Fixed bugs:**
718
740
 
@@ -762,7 +784,6 @@
762
784
  - Code smells [\#275](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/275) ([mhenrixon](https://github.com/mhenrixon))
763
785
  - Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
764
786
  - Improve testing [\#272](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/272) ([mhenrixon](https://github.com/mhenrixon))
765
- - Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
766
787
 
767
788
  ## [v6.0.0.beta](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta) (2018-06-17)
768
789
 
@@ -771,6 +792,7 @@
771
792
  **Implemented enhancements:**
772
793
 
773
794
  - Until and while executing [\#271](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/271) ([mhenrixon](https://github.com/mhenrixon))
795
+ - Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
774
796
  - Minor adjustments [\#268](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/268) ([mhenrixon](https://github.com/mhenrixon))
775
797
  - Use ruby 2.5.1 [\#267](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/267) ([mhenrixon](https://github.com/mhenrixon))
776
798
  - Add explicit concurrent-ruby dependency. [\#265](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/265) ([brettburley](https://github.com/brettburley))
@@ -931,7 +953,6 @@
931
953
  - Increase sleep delay in WhileExecuting\#synchronize [\#204](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/204) ([dsander](https://github.com/dsander))
932
954
  - Ensure job ID removed from uniquejobs hash [\#200](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/200) ([carlosmartinez](https://github.com/carlosmartinez))
933
955
  - unique args need to be an array [\#194](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/194) ([pboling](https://github.com/pboling))
934
- - fix for \#168. Handle the NOSCRIPT by sending the script again [\#178](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/178) ([otzy007](https://github.com/otzy007))
935
956
 
936
957
  ## [v4.0.18](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.18) (2016-07-24)
937
958
 
@@ -954,6 +975,7 @@
954
975
 
955
976
  - missed space [\#188](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/188) ([TheBigSadowski](https://github.com/TheBigSadowski))
956
977
  - Convert unless if to just 1 if [\#179](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/179) ([otzy007](https://github.com/otzy007))
978
+ - fix for \#168. Handle the NOSCRIPT by sending the script again [\#178](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/178) ([otzy007](https://github.com/otzy007))
957
979
  - Fixed gitter badge link [\#176](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/176) ([andrew](https://github.com/andrew))
958
980
 
959
981
  ## [v4.0.17](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.17) (2016-03-02)
@@ -1055,6 +1077,7 @@
1055
1077
  **Merged pull requests:**
1056
1078
 
1057
1079
  - Calculate worker's unique args when a proc or a symbol is specified [\#143](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/143) ([zeqfreed](https://github.com/zeqfreed))
1080
+ - Fix markdown link formatting [\#134](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/134) ([thbar](https://github.com/thbar))
1058
1081
 
1059
1082
  ## [v4.0.7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.7) (2015-10-14)
1060
1083
 
@@ -1085,7 +1108,6 @@
1085
1108
 
1086
1109
  **Merged pull requests:**
1087
1110
 
1088
- - Fix markdown link formatting [\#134](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/134) ([thbar](https://github.com/thbar))
1089
1111
  - Forces to look for testing namespace in Sidekiq and not his ancestors [\#129](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/129) ([antek-drzewiecki](https://github.com/antek-drzewiecki))
1090
1112
  - Fix outdated phrasing and add test coverage to readme [\#123](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/123) ([albertyw](https://github.com/albertyw))
1091
1113
 
@@ -10,9 +10,11 @@ module SidekiqUniqueJobs
10
10
  #
11
11
  class Cli < Thor
12
12
  # :nodoc:
13
+ # rubocop:disable Style/OptionalBooleanParameter
13
14
  def self.banner(command, _namespace = nil, _subcommand = false) # rubocop:disable Style/OptionalBooleanParameter
14
15
  "jobs #{@package_name} #{command.usage}" # rubocop:disable ThreadSafety/InstanceVariableInClassMethod
15
16
  end
17
+ # rubocop:enable Style/OptionalBooleanParameter
16
18
 
17
19
  desc "list PATTERN", "list all unique digests and their expiry time"
18
20
  option :count, aliases: :c, type: :numeric, default: 1000, desc: "The max number of digests to return"
@@ -7,6 +7,7 @@
7
7
  #
8
8
  module SidekiqUniqueJobs
9
9
  ARGS ||= "args"
10
+ APARTMENT ||= "apartment"
10
11
  AT ||= "at"
11
12
  CHANGELOGS ||= "uniquejobs:changelog"
12
13
  CLASS ||= "class"
@@ -40,19 +40,19 @@ module SidekiqUniqueJobs
40
40
  end
41
41
 
42
42
  def add_lock_timeout(item)
43
- item[LOCK_TIMEOUT] = SidekiqUniqueJobs::LockTimeout.calculate(item)
43
+ item[LOCK_TIMEOUT] ||= SidekiqUniqueJobs::LockTimeout.calculate(item)
44
44
  end
45
45
 
46
46
  def add_lock_args(item)
47
- item[LOCK_ARGS] = SidekiqUniqueJobs::LockArgs.call(item)
47
+ item[LOCK_ARGS] ||= SidekiqUniqueJobs::LockArgs.call(item)
48
48
  end
49
49
 
50
50
  def add_lock_digest(item)
51
- item[LOCK_DIGEST] = SidekiqUniqueJobs::LockDigest.call(item)
51
+ item[LOCK_DIGEST] ||= SidekiqUniqueJobs::LockDigest.call(item)
52
52
  end
53
53
 
54
54
  def add_lock_prefix(item)
55
- item[LOCK_PREFIX] = SidekiqUniqueJobs.config.unique_prefix
55
+ item[LOCK_PREFIX] ||= SidekiqUniqueJobs.config.unique_prefix
56
56
  end
57
57
  end
58
58
  end
@@ -58,7 +58,7 @@ module SidekiqUniqueJobs
58
58
  # Filter a hash to use for digest
59
59
  # @return [Hash] to use for digest
60
60
  def digestable_hash
61
- @item.slice(CLASS, QUEUE, LOCK_ARGS).tap do |hash|
61
+ @item.slice(CLASS, QUEUE, LOCK_ARGS, APARTMENT).tap do |hash|
62
62
  hash.delete(QUEUE) if unique_across_queues?
63
63
  hash.delete(CLASS) if unique_across_workers?
64
64
  end
@@ -25,11 +25,19 @@ module SidekiqUniqueJobs
25
25
  def self.configure_server # rubocop:disable Metrics/MethodLength
26
26
  Sidekiq.configure_server do |config|
27
27
  config.client_middleware do |chain|
28
- chain.add SidekiqUniqueJobs::Middleware::Client
28
+ if defined?(Apartment::Sidekiq::Middleware::Client)
29
+ chain.insert_after Apartment::Sidekiq::Middleware::Client, SidekiqUniqueJobs::Middleware::Client
30
+ else
31
+ chain.add SidekiqUniqueJobs::Middleware::Client
32
+ end
29
33
  end
30
34
 
31
35
  config.server_middleware do |chain|
32
- chain.add SidekiqUniqueJobs::Middleware::Server
36
+ if defined?(Apartment::Sidekiq::Middleware::Server)
37
+ chain.insert_after Apartment::Sidekiq::Middleware::Server, SidekiqUniqueJobs::Middleware::Server
38
+ else
39
+ chain.add SidekiqUniqueJobs::Middleware::Server
40
+ end
33
41
  end
34
42
 
35
43
  config.on(:startup) do
@@ -51,7 +59,11 @@ module SidekiqUniqueJobs
51
59
  def self.configure_client
52
60
  Sidekiq.configure_client do |config|
53
61
  config.client_middleware do |chain|
54
- chain.add SidekiqUniqueJobs::Middleware::Client
62
+ if defined?(Apartment::Sidekiq::Middleware::Client)
63
+ chain.insert_after Apartment::Sidekiq::Middleware::Client, SidekiqUniqueJobs::Middleware::Client
64
+ else
65
+ chain.add SidekiqUniqueJobs::Middleware::Client
66
+ end
55
67
  end
56
68
  end
57
69
  end
@@ -135,6 +135,8 @@ module SidekiqUniqueJobs
135
135
  return true if load_json(job)[LOCK_DIGEST] == digest
136
136
  end
137
137
  end
138
+
139
+ false
138
140
  end
139
141
  end
140
142
 
@@ -3,5 +3,5 @@
3
3
  module SidekiqUniqueJobs
4
4
  #
5
5
  # @return [String] the current SidekiqUniqueJobs version
6
- VERSION = "7.0.0.beta24"
6
+ VERSION = "7.0.0.beta25"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-unique-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0.beta24
4
+ version: 7.0.0.beta25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-27 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brpoplpush-redis_script
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  - !ruby/object:Gem::Version
240
240
  version: 1.3.1
241
241
  requirements: []
242
- rubygems_version: 3.1.4
242
+ rubygems_version: 3.0.3
243
243
  signing_key:
244
244
  specification_version: 4
245
245
  summary: Sidekiq middleware that prevents duplicates jobs