sidekiq-unique-jobs 4.0.0 → 4.0.7

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.

Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.simplecov +1 -1
  3. data/.travis.yml +1 -2
  4. data/Appraisals +1 -1
  5. data/CHANGELOG.md +44 -1
  6. data/Gemfile +1 -2
  7. data/README.md +49 -51
  8. data/circle.yml +3 -1
  9. data/gemfiles/sidekiq_2.17.gemfile +7 -5
  10. data/gemfiles/sidekiq_3.0.gemfile +6 -4
  11. data/gemfiles/sidekiq_3.1.gemfile +6 -4
  12. data/gemfiles/sidekiq_3.2.gemfile +6 -4
  13. data/gemfiles/sidekiq_3.3.gemfile +6 -4
  14. data/gemfiles/sidekiq_develop.gemfile +6 -4
  15. data/lib/sidekiq-unique-jobs.rb +3 -6
  16. data/lib/sidekiq_unique_jobs/config.rb +1 -6
  17. data/lib/sidekiq_unique_jobs/constants.rb +17 -0
  18. data/lib/sidekiq_unique_jobs/core_ext.rb +28 -23
  19. data/lib/sidekiq_unique_jobs/lock.rb +1 -1
  20. data/lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb +13 -0
  21. data/lib/sidekiq_unique_jobs/lock/until_executed.rb +17 -3
  22. data/lib/sidekiq_unique_jobs/lock/until_executing.rb +4 -0
  23. data/lib/sidekiq_unique_jobs/lock/until_timeout.rb +9 -2
  24. data/lib/sidekiq_unique_jobs/lock/while_executing.rb +17 -5
  25. data/lib/sidekiq_unique_jobs/options_with_fallback.rb +14 -5
  26. data/lib/sidekiq_unique_jobs/server/middleware.rb +3 -40
  27. data/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb +29 -2
  28. data/lib/sidekiq_unique_jobs/testing/sidekiq_overrides.rb +6 -2
  29. data/lib/sidekiq_unique_jobs/timeout_calculator.rb +42 -0
  30. data/lib/sidekiq_unique_jobs/unique_args.rb +31 -29
  31. data/lib/sidekiq_unique_jobs/version.rb +1 -1
  32. data/redis/synchronize.lua +1 -1
  33. data/sidekiq-unique-jobs.gemspec +1 -2
  34. data/spec/{workers/unique_worker.rb → jobs/another_unique_job.rb} +3 -3
  35. data/spec/{workers/queue_worker.rb → jobs/custom_queue_job.rb} +1 -1
  36. data/spec/jobs/custom_queue_job_with_filter_method.rb +7 -0
  37. data/spec/{workers/queue_worker_with_filter_proc.rb → jobs/custom_queue_job_with_filter_proc.rb} +2 -3
  38. data/spec/jobs/expiring_job.rb +4 -0
  39. data/spec/{workers → jobs}/inline_worker.rb +1 -1
  40. data/spec/jobs/just_a_worker.rb +8 -0
  41. data/spec/jobs/main_job.rb +8 -0
  42. data/spec/{workers/my_worker.rb → jobs/my_job.rb} +2 -3
  43. data/spec/jobs/my_unique_job.rb +7 -0
  44. data/spec/{workers → jobs}/plain_class.rb +0 -0
  45. data/spec/{workers → jobs}/test_class.rb +0 -0
  46. data/spec/{workers → jobs}/unique_job_with_filter_method.rb +2 -2
  47. data/spec/{workers/unique_on_all_queues_worker.rb → jobs/unique_on_all_queues_job.rb} +3 -3
  48. data/spec/jobs/until_and_while_executing_job.rb +8 -0
  49. data/spec/{workers/another_unique_worker.rb → jobs/until_executed_job.rb} +6 -2
  50. data/spec/jobs/until_executing_job.rb +8 -0
  51. data/spec/jobs/until_global_timeout_job.rb +8 -0
  52. data/spec/{workers/inline_expiration_worker.rb → jobs/until_timeout_job.rb} +2 -2
  53. data/spec/{workers/after_unlock_worker.rb → jobs/while_executing_job.rb} +2 -3
  54. data/spec/lib/sidekiq_unique_jobs/client/middleware_spec.rb +60 -44
  55. data/spec/lib/sidekiq_unique_jobs/lock/until_and_while_executing_spec.rb +39 -0
  56. data/spec/lib/sidekiq_unique_jobs/lock/until_executed_spec.rb +40 -0
  57. data/spec/lib/sidekiq_unique_jobs/lock/while_executing_spec.rb +15 -4
  58. data/spec/lib/sidekiq_unique_jobs/options_with_fallback_spec.rb +25 -0
  59. data/spec/lib/sidekiq_unique_jobs/scripts_spec.rb +3 -4
  60. data/spec/lib/sidekiq_unique_jobs/server/middleware_spec.rb +51 -68
  61. data/spec/lib/sidekiq_unique_jobs/sidekiq_testing_enabled_spec.rb +75 -79
  62. data/spec/lib/sidekiq_unique_jobs/sidekiq_unique_ext_spec.rb +2 -2
  63. data/spec/lib/sidekiq_unique_jobs/{lock/time_calculator_spec.rb → timeout_calculator_spec.rb} +10 -11
  64. data/spec/lib/sidekiq_unique_jobs/unique_args_spec.rb +28 -45
  65. data/spec/spec_helper.rb +23 -15
  66. data/spec/support/unique_macros.rb +20 -1
  67. metadata +30 -42
  68. data/lib/sidekiq_unique_jobs/lock/time_calculator.rb +0 -44
  69. data/spec/workers/after_yield_worker.rb +0 -17
  70. data/spec/workers/before_yield_worker.rb +0 -9
  71. data/spec/workers/expiring_worker.rb +0 -4
  72. data/spec/workers/inline_unlock_order_worker.rb +0 -8
  73. data/spec/workers/just_a_worker.rb +0 -8
  74. data/spec/workers/main_job.rb +0 -8
  75. data/spec/workers/my_unique_worker.rb +0 -8
  76. data/spec/workers/queue_worker_with_filter_method.rb +0 -7
  77. data/spec/workers/run_lock_with_retries_worker.rb +0 -12
  78. data/spec/workers/run_lock_worker.rb +0 -7
  79. data/spec/workers/while_executing_worker.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9335a1bcf7592b094855e9d4562840691c9bcc96
4
- data.tar.gz: bdd063a97f2a10c1844dda8c51b42221b50a52b6
3
+ metadata.gz: 5d354eaf8918e64ccbe7873ea1bc4a2f04392d78
4
+ data.tar.gz: 048516acc45e64d59f19e2f080b98d975a4b2d65
5
5
  SHA512:
6
- metadata.gz: 2fd7ce95d41c91ec3155336cf7961e1d6986e92a261e8bde242ed2a720338abff103754c7973cad85d3a29b2f69d13234379877f64b466498ff904d86c6b0729
7
- data.tar.gz: 7b3488a1eba8ff8b2457d5f70b1253dbdffff3bfca249cee54bf4f6a2673360ea3ce22b573c1297d5ee59959a430f9408e385f9cc4c6bb448966f0b16ef2b3fb
6
+ metadata.gz: 481a2053ca531710e228bf8d2da432f353c5f14af4f3d82f9748271ee190cf10ff9fcd1fb353bf16942fa56277cef5f31a0413d63ebdc657e653f56809533753
7
+ data.tar.gz: 104340d1f76fc29dab974c93afe7823ff673fa20a4349a819320fdb1f87916eba3b21f11d8484e8b1abaaca558500eca5a3296bc0fb56eb8b99669162822ed0b
data/.simplecov CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'simplecov-json'
2
2
 
3
- SimpleCov.refuse_coverage_drop
3
+ # SimpleCov.refuse_coverage_drop
4
4
  SimpleCov.formatters = [
5
5
  SimpleCov::Formatter::HTMLFormatter,
6
6
  SimpleCov::Formatter::JSONFormatter
@@ -10,7 +10,6 @@ rvm:
10
10
  - jruby-19mode
11
11
  - jruby-9.0.0.0
12
12
  - rbx-2
13
- - 2.0.0
14
13
  - 2.1.7
15
14
  - 2.2.3
16
15
  env: STYLE=false
@@ -30,5 +29,5 @@ matrix:
30
29
  fast_finish: true
31
30
  include:
32
31
  - rvm: 2.2.3
33
- gemfile: gemfiles/sidekiq_3.3.gemfile
32
+ gemfile: gemfiles/sidekiq_develop.gemfile
34
33
  env: STYLE=true
data/Appraisals CHANGED
@@ -3,7 +3,7 @@ appraise 'sidekiq-develop' do
3
3
  end
4
4
 
5
5
  appraise 'sidekiq-2.17' do
6
- gem 'sidekiq', '~> 2.17.0'
6
+ gem 'sidekiq', '~> 2.17.4'
7
7
  end
8
8
 
9
9
  appraise 'sidekiq-3.0' do
@@ -1,52 +1,95 @@
1
- ## v3.0.16 (Unreleased)
1
+ ## v4.0.7
2
+
3
+ - Use unique arguments for the `WhileExecuting` lock (#127)
4
+
5
+ ## v4.0.6
6
+
7
+ - Removes enforced uniqueness for all jobs (#127)
8
+
9
+ ## v4.0.5
10
+
11
+ - Forces look for `Sidekiq::Testing` in Sidekiq without ancestors #129
12
+
13
+ ## v4.0.4
14
+
15
+ - Fix usage with active job
16
+ - Get rid of unneeded configuration options `unique_args_enabled` (just use whatever unique argument that is configured).
17
+
18
+ ## v4.0.3
19
+
20
+ - Remove `unique_lock` and use `unique: ` to set this like in `unique: :until_timeout`
21
+ - Warn when using `unique: true` and suggest to change it to what we need with a fallback.
22
+ - Create constants for hash keys to avoid having to fix spelling or for renaming keys only having to be done in one place and avoid having to type .freeze everywhere.
23
+ - Move all explicit logic out from the server middle ware and make it just call execute on the instance of the lock class (prepare for allowing custom locking classes to be used).
24
+ - Create a new job for scheduling jobs after it started executing but only allow one job to run at the same time.
25
+
26
+ ## v4.0.2
27
+
28
+ - Fix a problem with an unresolved reference
29
+
30
+ ## v4.0.1
31
+
32
+ - Get rid of development dependency on active support (causing trouble with jruby)
33
+
34
+ ## v4.0.0
2
35
 
3
36
  - Improved uniqueness handling (complete refactoring, upgrade with causion)
4
37
  - 100% breaking changes
5
38
 
6
39
  ## v3.0.15
40
+
7
41
  - Jobs only ever unlock themselves now (see #96 & #94 for info) thanks @pik
8
42
  - Slight refactoring and internal renaming. Shouldn't affect anyone
9
43
  - Run locks as an alternative when you only need to prevent the same job running twice but want to be able to schedule it multiple times. See #99 (thanks @pik)
10
44
  - Fixes #90, #92, #93, #97, #98, #100, #101, #105
11
45
 
12
46
  ## v3.0.14
47
+
13
48
  - Improve uniqueness check performance thanks @mpherham
14
49
  - Remove locks in sidekiq fake testing mode
15
50
  - Do not unlock jobs when sidekiq is shutting down
16
51
 
17
52
  ## v3.0.13
53
+
18
54
  - Improved testing capabilities (testing uniqueness should not work better)
19
55
  - Configurable logging of duplicate payloads
20
56
  - Now requires `sidekiq_unique_ext` and `sidekiq/api` by default
21
57
  - Drop support for MRI 1.9 and sidekiq 2
22
58
 
23
59
  ## v3.0.11
60
+
24
61
  - Ensure threadsafety (thanks to adstage-david)
25
62
 
26
63
  ## v3.0.9
27
64
  - Fixed that all jobs stopped processing
28
65
 
29
66
  ## v3.0.8
67
+
30
68
  - Unique extensions for Web GUI by @rickenharp. Uniqueness will now be removed when a job is.
31
69
 
32
70
  ## v3.0.7
71
+
33
72
  - Internal refactoring
34
73
  - Improved coverage
35
74
  - Rubocop style validation
36
75
 
37
76
  ## v3.0.5
77
+
38
78
  - Fixed the different test modes (major thanks to @salrepe)
39
79
 
40
80
  ## v3.0.2
81
+
41
82
  - Removed runtime dependency on mock_redis (add `gem 'mock_redis'` to your desired group to use it)
42
83
 
43
84
  ## v2.7.0
85
+
44
86
  - Use mock_redis when testing in fake mode
45
87
  - Replace minitest with rspec
46
88
  - Add codeclimate badge
47
89
  - Update travis with redis-server
48
90
 
49
91
  ## v2.6.5
92
+
50
93
  - via @sax - possibility to set which arguments should be counted as unique - https://github.com/form26/sidekiq_unique_jobs/pull/12
51
94
  - via @eduardosasso - possibility to set which arguments should be counted as unique - https://github.com/form26/sidekiq_unique_jobs/pull/11
52
95
  - via @KensoDev - configuration of default expiration - https://github.com/form26/sidekiq_unique_jobs/pull/9
data/Gemfile CHANGED
@@ -2,10 +2,9 @@ source 'http://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  gem 'appraisal', '~> 2.0.0'
5
-
6
5
  gem 'rspec-its', require: false
7
6
 
8
- platform :mri do
7
+ platform :mri_22 do
9
8
  gem 'pry', require: false
10
9
  gem 'pry-rescue', require: false
11
10
  gem 'pry-byebug', require: false
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # SidekiqUniqueJobs [![Build Status](https://travis-ci.org/mhenrixon/sidekiq-unique-jobs.png?branch=master)](https://travis-ci.org/mhenrixon/sidekiq-unique-jobs) [![Code Climate](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs.png)](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs)
1
+ # SidekiqUniqueJobs [![Build Status](https://travis-ci.org/mhenrixon/sidekiq-unique-jobs.png?branch=master)](https://travis-ci.org/mhenrixon/sidekiq-unique-jobs) [![Code Climate](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs.png)](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs) [![Test Coverage](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs/badges/coverage.svg)](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs/coverage)
2
2
 
3
3
  The missing unique jobs for sidekiq
4
4
 
@@ -6,12 +6,13 @@ The missing unique jobs for sidekiq
6
6
 
7
7
  See https://github.com/mperham/sidekiq#requirements for what is required. Starting from 3.0.13 only sidekiq 3 is supported and support for MRI 1.9 is dropped (it might work but won't be worked on)
8
8
 
9
- Version 4 requires redis 2.6.2!! Don't upgrade to version 4 unless you are on redis 2.6.2.
9
+ ### Version 4 Upgrade instructions
10
10
 
11
- ## Upgrade instructions
11
+ Version 4 requires redis >= 2.6.2!! Don't upgrade to version 4 unless you are on redis >= 2.6.2.
12
12
 
13
13
  Easy path - Drop all your unique jobs before upgrading the gem!
14
- Hard path - See above... Start with a clean slate :)
14
+
15
+ Hard path - See below... Start with a clean slate :)
15
16
 
16
17
  ## Installation
17
18
 
@@ -35,20 +36,52 @@ To make things worse there are many ways of wanting to enforce uniqueness.
35
36
 
36
37
  ### While Executing
37
38
 
39
+ Due to discoverability of the different lock types `unique` sidekiq option it was decided to use the `while_executing` as a default. Most people will note that scheduling any number of jobs with the same arguments is possible.
40
+
41
+ ```ruby
42
+ sidekiq_options unique: :while_executing
43
+ ```
44
+
38
45
  Is to make sure that a job can be scheduled any number of times but only executed a single time per argument provided to the job we call this runtime uniqueness. This is probably most useful forbackground jobs that are fast to execute. (See mhenrixon/sidekiq-unique-jobs#111 for a great example of when this would be right.) While the job is executing/performing no other jobs can be executed at the same time.
39
46
 
40
47
  ### Until Executing
41
48
 
49
+ ```ruby
50
+ sidekiq_options unique: :until_executing
51
+ ```
52
+
42
53
  This means that a job can only be scheduled into redis once per whatever the configuration of unique arguments. Any jobs added until the first one of the same arguments has been unlocked will just be dropped. This is what was tripping many people up. They would schedule a job to run in the future and it would be impossible to schedule new jobs with those same arguments even immediately. There was some forth and back between also locking jobs on the scheduled queue and the regular queues but in the end I decided it was best to separate these two features out into different locking mechanisms. I think what most people are after is to be able to lock a job while executing or that seems to be what people are most missing at the moment.
43
54
 
44
55
  ### Until Executed
45
56
 
57
+ ```ruby
58
+ sidekiq_options unique: :until_executed
59
+ ```
60
+
46
61
  This is the combination of the two above. First we lock the job until it executes, then as the job begins executes we keep the lock so that no other jobs with the same arguments can execute at the same time.
47
62
 
48
63
  ### Until Timeout
49
64
 
65
+ ```ruby
66
+ sidekiq_options unique: :until_timeout
67
+ ```
68
+
50
69
  The job won't be unlocked until the timeout/expiry runs out.
51
70
 
71
+ ### Unique Until And While Executing
72
+
73
+ ```ruby
74
+ sidekiq_options unique: :until_and_while_executing
75
+ ```
76
+
77
+ This lock is exactly what you would expect. It is considered unique in a way until executing begins and it is locked while executing so what differs from `UntilExecuted`?
78
+
79
+ The difference is that this job has two types of uniqueness:
80
+ 1. It is unique until execution
81
+ 2. It is unique while executing
82
+
83
+ That means it locks for any job with the same arguments to be persisted into redis and just like you would expect it will only ever allow one job of the same unique arguments to run at any given time but as soon as the runtime lock has been aquired the schedule/async lock is released.
84
+
52
85
  ### Uniqueness Scope
53
86
 
54
87
  - Queue specific locks
@@ -57,10 +90,10 @@ The job won't be unlocked until the timeout/expiry runs out.
57
90
 
58
91
  ## Usage
59
92
 
60
- All that is required is that you specifically set the sidekiq option for *unique* to true like below:
93
+ All that is required is that you specifically set the sidekiq option for *unique* to a valid value like below:
61
94
 
62
95
  ```ruby
63
- sidekiq_options unique: true
96
+ sidekiq_options unique: :while_executing
64
97
  ```
65
98
 
66
99
  For jobs scheduled in the future it is possible to set for how long the job
@@ -68,12 +101,12 @@ should be unique. The job will be unique for the number of seconds configured (d
68
101
  or until the job has been completed. Thus, the job will be unique for the shorter of the two. Note that Sidekiq versions before 3.0 will remove job keys after an hour, which means jobs can remain unique for at most an hour.
69
102
 
70
103
  *If you want the unique job to stick around even after it has been successfully
71
- processed then just set the unique_lock to anything except `:before_yield` or `:after_yield` (`unique_lock = :until_timeout`)
104
+ processed then just set `unique: :until_timeout`.
72
105
 
73
106
  You can also control the expiration length of the uniqueness check. If you want to enforce uniqueness over a longer period than the default of 30 minutes then you can pass the number of seconds you want to use to the sidekiq options:
74
107
 
75
108
  ```ruby
76
- sidekiq_options unique: true, unique_expiration: 120 * 60 # 2 hours
109
+ sidekiq_options unique: :until_timeout, unique_expiration: 120 * 60 # 2 hours
77
110
  ```
78
111
 
79
112
  Requiring the gem in your gemfile should be sufficient to enable unique jobs.
@@ -82,31 +115,24 @@ Requiring the gem in your gemfile should be sufficient to enable unique jobs.
82
115
 
83
116
  ```ruby
84
117
  Sidekiq.default_worker_options = {
85
- 'unique' => true,
86
- 'unique_args' => proc do |args|
87
- [args.first.except('job_id')]
88
- end
118
+ unique: :until_executing,
119
+ unique_args: ->(args) { args.first.except('job_id') }
89
120
  }
90
- SidekiqUniqueJobs.config.unique_args_enabled = true
91
121
  ```
92
122
 
93
123
 
94
124
  ### Finer Control over Uniqueness
95
125
 
96
- Sometimes it is desired to have a finer control over which arguments are used in determining uniqueness of the job, and others may be _transient_. For this use-case, you need to set `SidekiqUniqueJobs.config.unique_args_enabled` to true in an initializer, and then defined either `unique_args` method, or a ruby proc.
126
+ Sometimes it is desired to have a finer control over which arguments are used in determining uniqueness of the job, and others may be _transient_. For this use-case, you need to define either a `unique_args` method, or a ruby proc.
97
127
 
98
128
  The unique_args method need to return an array of values to use for uniqueness check.
99
129
 
100
- ```ruby
101
- SidekiqUniqueJobs.config.unique_args_enabled = true
102
- ```
103
-
104
130
  The method or the proc can return a modified version of args without the transient arguments included, as shown below:
105
131
 
106
132
  ```ruby
107
133
  class UniqueJobWithFilterMethod
108
134
  include Sidekiq::Worker
109
- sidekiq_options unique: true,
135
+ sidekiq_options unique: :until_and_during_execution,
110
136
  unique_args: :unique_args
111
137
 
112
138
  def self.unique_args(name, id, options)
@@ -119,7 +145,7 @@ end
119
145
 
120
146
  class UniqueJobWithFilterProc
121
147
  include Sidekiq::Worker
122
- sidekiq_options unique: true,
148
+ sidekiq_options unique: :until_executed,
123
149
  unique_args: ->(args) { [ args.first ] }
124
150
 
125
151
  ...
@@ -127,22 +153,7 @@ class UniqueJobWithFilterProc
127
153
  end
128
154
  ```
129
155
 
130
- Note that objects passed into workers are converted to JSON *after* running through client middleware. In server middleware, the JSON is passed directly to the worker `#perform` method. So, you may run into issues where the arguments are different when enqueuing than they are when performing. Your `unique_args` method may need to account for this.
131
-
132
- ### Unlock Ordering
133
-
134
- By default the server middleware will release the worker lock after yielding to the next middleware or worker. Alternatively, this can be changed by passing the `unique_lock` option:
135
-
136
- ```ruby
137
- class UniqueJobWithFilterMethod
138
- include Sidekiq::Worker
139
- sidekiq_options unique: true,
140
- unique_locks: :until_executing
141
-
142
- ...
143
-
144
- end
145
- ```
156
+ The previous problems with unique args being string in server and symbol in client is no longer a problem because the `UniqueArgs` class accounts for this and converts everything to json now. If you find an edge case please provide and example so that we can add coverage and fix it.
146
157
 
147
158
  ### After Unlock Callback
148
159
 
@@ -151,7 +162,7 @@ If you are using :after_yield as your unlock ordering, Unique Job offers a callb
151
162
  ```ruby
152
163
  class UniqueJobWithFilterMethod
153
164
  include Sidekiq::Worker
154
- sidekiq_options unique: true,
165
+ sidekiq_options unique: :while_executing,
155
166
 
156
167
  def after_unlock
157
168
  # block has yielded and lock is released
@@ -161,17 +172,6 @@ end.
161
172
 
162
173
  ```
163
174
 
164
- ### Unique Storage Method
165
-
166
- Starting from sidekiq-unique-jobs 3.0.14 we will use the `set` method in a way that has been available since redis 2.6.12. If you are on an older redis version you will have to change a config value like below.
167
-
168
- ```ruby
169
- SidekiqUniqueJobs.config.unique_storage_method = :old
170
- ```
171
-
172
- That should allow you to keep using redis in the old fashion way. See #89 for mor information.
173
-
174
-
175
175
  ### Logging
176
176
 
177
177
  To see logging in sidekiq when duplicate payload has been filtered out you can enable on a per worker basis using the sidekiq options. The default value is false
@@ -179,7 +179,7 @@ To see logging in sidekiq when duplicate payload has been filtered out you can e
179
179
  ```ruby
180
180
  class UniqueJobWithFilterMethod
181
181
  include Sidekiq::Worker
182
- sidekiq_options unique: true,
182
+ sidekiq_options unique: :while_executing,
183
183
  log_duplicate_payload: true
184
184
 
185
185
  ...
@@ -191,8 +191,6 @@ end
191
191
 
192
192
  To enable the testing for `sidekiq-unique-jobs`, add `require 'sidekiq_unique_jobs/testing'` to your testing helper.
193
193
 
194
- SidekiqUniqueJobs uses mock_redis for inline testing. Due to complaints about having that as a runtime dependency it was made a development dependency so if you are relying on inline testing you will have to add `gem 'mock_redis'` to your Gemfile.
195
-
196
194
  ## Contributing
197
195
 
198
196
  1. Fork it
data/circle.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  machine:
2
- ruby: 2.2.3
2
+ ruby:
3
+ version:
4
+ 2.2.3
3
5
  java:
4
6
  version: oraclejdk8
5
7
  environment:
@@ -3,13 +3,15 @@
3
3
  source "http://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.0.0"
6
- gem "sidekiq", "~> 2.17.0"
6
+ gem "rspec-its", :require => false
7
+ gem "sidekiq", "~> 2.17.4"
7
8
 
8
- platforms :mri do
9
- gem "pry-suite", :require => false
10
- gem "let_it_go", :require => false
11
- gem "memory-profiler", :require => false
9
+ platforms :mri_22 do
10
+ gem "pry", :require => false
11
+ gem "pry-rescue", :require => false
12
+ gem "pry-byebug", :require => false
12
13
  gem "simplecov-json", :require => false
14
+ gem "memory_profiler", :require => false
13
15
  gem "codeclimate-test-reporter", :require => false
14
16
  end
15
17
 
@@ -3,13 +3,15 @@
3
3
  source "http://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.0.0"
6
+ gem "rspec-its", :require => false
6
7
  gem "sidekiq", "~> 3.0.0"
7
8
 
8
- platforms :mri do
9
- gem "pry-suite", :require => false
10
- gem "let_it_go", :require => false
11
- gem "memory-profiler", :require => false
9
+ platforms :mri_22 do
10
+ gem "pry", :require => false
11
+ gem "pry-rescue", :require => false
12
+ gem "pry-byebug", :require => false
12
13
  gem "simplecov-json", :require => false
14
+ gem "memory_profiler", :require => false
13
15
  gem "codeclimate-test-reporter", :require => false
14
16
  end
15
17
 
@@ -3,13 +3,15 @@
3
3
  source "http://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.0.0"
6
+ gem "rspec-its", :require => false
6
7
  gem "sidekiq", "~> 3.1.0"
7
8
 
8
- platforms :mri do
9
- gem "pry-suite", :require => false
10
- gem "let_it_go", :require => false
11
- gem "memory-profiler", :require => false
9
+ platforms :mri_22 do
10
+ gem "pry", :require => false
11
+ gem "pry-rescue", :require => false
12
+ gem "pry-byebug", :require => false
12
13
  gem "simplecov-json", :require => false
14
+ gem "memory_profiler", :require => false
13
15
  gem "codeclimate-test-reporter", :require => false
14
16
  end
15
17
 
@@ -3,13 +3,15 @@
3
3
  source "http://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.0.0"
6
+ gem "rspec-its", :require => false
6
7
  gem "sidekiq", "~> 3.2.0"
7
8
 
8
- platforms :mri do
9
- gem "pry-suite", :require => false
10
- gem "let_it_go", :require => false
11
- gem "memory-profiler", :require => false
9
+ platforms :mri_22 do
10
+ gem "pry", :require => false
11
+ gem "pry-rescue", :require => false
12
+ gem "pry-byebug", :require => false
12
13
  gem "simplecov-json", :require => false
14
+ gem "memory_profiler", :require => false
13
15
  gem "codeclimate-test-reporter", :require => false
14
16
  end
15
17