sidekiq-unique-jobs 6.0.0.rc5 → 6.0.0.rc6

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: 3df0619967957fbdd6ab3ad531c431c1568d6c60d1f361102d61ff7be4d5e042
4
- data.tar.gz: 7e27f64fe78e85d73e0a41503ab818794abd7212222030935314bacc8507f89c
3
+ metadata.gz: a18917b728c376204bb49c0d25e9114c5a512aaff454cb2276fc3de1f9bc9044
4
+ data.tar.gz: fab057843aa50766cb6adedcdf180aea0e67eba70ed4db8bf700c710621db47a
5
5
  SHA512:
6
- metadata.gz: 7b4bc2dcd6ce5b91a026c75b9b8c8047f9f775a63c10b2ea51635a297c5c4d42dd50b52344aad83ee82416db9663b674415afbc357ebc1e6aa5d4b8d7e61bb94
7
- data.tar.gz: c0567aff2225853eede158a18a147456c45b2630b06ff6b4efcd3f4e83bc9277a212eb532fd109b1540a2babba7a08eb71e00743b41f84854105a37e39ca9aaf
6
+ metadata.gz: c9797381413519ef4901151f3db6087681c292e4d163b23b4f616e4f5da2bcec47356c53a9da9b03333c86eabade31a58786e0c1c14a3aadbffa25841d1f5dcb
7
+ data.tar.gz: b409a5e4f6f09b912f64f6326da125e9041c2f73964202710e2d396a211acdf5e41e9b72e52aa1b26795bfe98e0309ebbc99d7d6b2d4417e9aaeeadab316e226
data/.travis.yml CHANGED
@@ -28,12 +28,8 @@ rvm:
28
28
  - 2.5.1
29
29
  - 2.4.2
30
30
  - 2.3.2
31
- - jruby-9.1.17.0
32
31
  - jruby-9.2.0.0
33
32
  matrix:
34
- allow_failures:
35
- - rvm: jruby-9.1.17.0
36
- - rvm: jruby-9.2.0.0
37
33
  fast_finish: true
38
34
  include:
39
35
  - rvm: 2.5.1
data/README.md CHANGED
@@ -1,6 +1,40 @@
1
1
  # SidekiqUniqueJobs [![Join the chat at https://gitter.im/mhenrixon/sidekiq-unique-jobs](https://badges.gitter.im/mhenrixon/sidekiq-unique-jobs.svg)](https://gitter.im/mhenrixon/sidekiq-unique-jobs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![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
- The missing unique jobs for sidekiq
3
+ ## Table of contents
4
+
5
+ * [Introduction](#introduction)
6
+ * [Documentation](#documentation)
7
+ * [Requirements](#requirements)
8
+ * [Installation](#installation)
9
+ * [General Information](#general-information)
10
+ * [Options](#options)
11
+ * [Lock Expiration](#lock-expiration)
12
+ * [Lock Timeout](#lock-timeout)
13
+ * [Unique Across Queues](#unique-across-queues)
14
+ * [Unique Across Workers](#unique-across-workers)
15
+ * [Locks](#locks)
16
+ * [Until Executing](#until-executing)
17
+ * [Until Executed](#until-executed)
18
+ * [Until Timeout](#until-timeout)
19
+ * [Unique Until And While Executing](#unique-until-and-while-executing)
20
+ * [While Executing](#while-executing)
21
+ * [Usage](#usage)
22
+ * [Finer Control over Uniqueness](#finer-control-over-uniqueness)
23
+ * [After Unlock Callback](#after-unlock-callback)
24
+ * [Logging](#logging)
25
+ * [Debugging](#debugging)
26
+ * [Console](#console)
27
+ * [List Unique Keys](#list-unique-keys)
28
+ * [Remove Unique Keys](#remove-unique-keys)
29
+ * [Command Line](#command-line)
30
+ * [Communication](#communication)
31
+ * [Testing](#testing)
32
+ * [Contributing](#contributing)
33
+ * [Contributors](#contributors)
34
+
35
+ ## Introduction
36
+
37
+ The goal of this gem is to ensure your Sidekiq jobs are unique. We do this by creating unique keys in Redis based on how you configure uniqueness.
4
38
 
5
39
  ## Documentation
6
40
 
@@ -37,9 +71,9 @@ See [Interaction w/ Sidekiq](https://github.com/mhenrixon/sidekiq-unique-jobs/wi
37
71
 
38
72
  See [Locking & Unlocking](https://github.com/mhenrixon/sidekiq-unique-jobs/wiki/Locking-&-Unlocking) for an overview of the differences on when the various lock types are locked and unlocked.
39
73
 
40
- ### Options
74
+ ## Options
41
75
 
42
- #### Lock Expiration
76
+ ### Lock Expiration
43
77
 
44
78
  This is probably not the configuration option you want...
45
79
 
@@ -52,7 +86,7 @@ sidekiq_options lock_expiration: nil # default - don't expire keys
52
86
  sidekiq_options lock_expiration: 20.days # expire this lock in 20 days
53
87
  ```
54
88
 
55
- #### Lock Timeout
89
+ ### Lock Timeout
56
90
 
57
91
  This is the timeout (how long to wait) when creating the lock. By default we don't use a timeout so we won't wait for the lock to be created. If you want it is possible to set this like below.
58
92
 
@@ -62,7 +96,7 @@ sidekiq_options lock_timeout: 5 # wait 5 seconds
62
96
  sidekiq_options lock_timeout: nil # lock indefinitely, this process won't continue until it gets a lock. VERY DANGEROUS!!
63
97
  ```
64
98
 
65
- #### Unique Across Queues
99
+ ### Unique Across Queues
66
100
 
67
101
  This configuration option is slightly misleading. It doesn't disregard the queue on other jobs. Just on itself, this means that a worker that might schedule jobs into multiple queues will be able to have uniqueness enforced on all queues it is pushed to.
68
102
 
@@ -78,7 +112,7 @@ end
78
112
 
79
113
  Now if you push override the queue with `Worker.set(queue: 'another').perform_async(1)` it will still be considered unique when compared to `Worker.perform_async(1)` (that was actually pushed to the queue `default`).
80
114
 
81
- #### Unique Across Workers
115
+ ### Unique Across Workers
82
116
 
83
117
  This configuration option is slightly misleading. It doesn't disregard the worker class on other jobs. Just on itself, this means that a worker that the worker class won't be used for generating the unique digest. The only way this option really makes sense is when you want to have uniqueness between two different worker classes.
84
118
 
@@ -107,9 +141,7 @@ WorkerTwo.perform_async(1)
107
141
  # => nil because WorkerOne just stole the lock
108
142
  ```
109
143
 
110
- ### Locks
111
-
112
- ####
144
+ ## Locks
113
145
 
114
146
  ### Until Executing
115
147
 
@@ -313,16 +345,7 @@ end
313
345
  4. Push to the branch (`git push origin my-new-feature`)
314
346
  5. Create new Pull Request
315
347
 
316
- ## Contributors
317
348
 
318
- In no particular order:
349
+ ## Contributors
319
350
 
320
- - https://github.com/salrepe
321
- - https://github.com/rickenharp
322
- - https://github.com/sax
323
- - https://github.com/eduardosasso
324
- - https://github.com/KensoDev
325
- - https://github.com/adstage-david
326
- - https://github.com/jprincipe
327
- - https://github.com/crberube
328
- - https://github.com/simonoff
351
+ You can find a list of contributors over on https://github.com/mhenrixon/sidekiq-unique-jobs/graphs/contributors
data/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-merlot
@@ -9,7 +9,6 @@ module SidekiqUniqueJobs
9
9
  @item = prepare_item(item)
10
10
  @callback = callback
11
11
  @redis_pool = redis_pool
12
- @operative = true
13
12
  end
14
13
 
15
14
  def lock
@@ -38,7 +37,7 @@ module SidekiqUniqueJobs
38
37
 
39
38
  private
40
39
 
41
- attr_reader :item, :redis_pool, :operative, :callback
40
+ attr_reader :item, :redis_pool, :callback
42
41
 
43
42
  def locksmith
44
43
  @locksmith ||= SidekiqUniqueJobs::Locksmith.new(item, redis_pool)
@@ -47,9 +46,9 @@ module SidekiqUniqueJobs
47
46
  def with_cleanup
48
47
  yield
49
48
  rescue Sidekiq::Shutdown
50
- @operative = false
49
+ notify_about_manual_unlock
51
50
  raise
52
- ensure
51
+ else
53
52
  unlock_with_callback
54
53
  end
55
54
 
@@ -67,7 +66,6 @@ module SidekiqUniqueJobs
67
66
  end
68
67
 
69
68
  def unlock_with_callback
70
- return notify_about_manual_unlock unless operative
71
69
  return notify_about_manual_unlock unless unlock
72
70
 
73
71
  callback_safely
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqUniqueJobs
4
- VERSION = '6.0.0.rc5'
4
+ VERSION = '6.0.0.rc6'
5
5
  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: 6.0.0.rc5
4
+ version: 6.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-30 00:00:00.000000000 Z
11
+ date: 2018-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -193,6 +193,7 @@ files:
193
193
  - LICENSE.txt
194
194
  - README.md
195
195
  - Rakefile
196
+ - _config.yml
196
197
  - bin/bench
197
198
  - bin/uniquejobs
198
199
  - examples/another_unique_job.rb
@@ -288,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
289
  version: 1.3.1
289
290
  requirements: []
290
291
  rubyforge_project:
291
- rubygems_version: 2.7.6
292
+ rubygems_version: 2.7.7
292
293
  signing_key:
293
294
  specification_version: 4
294
295
  summary: Uniqueness for Sidekiq Jobs