sidekiq-lock 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +5 -2
- data/lib/sidekiq/lock/redis_lock.rb +3 -3
- data/lib/sidekiq/lock/version.rb +1 -1
- data/test/test_helper.rb +0 -5
- metadata +8 -32
- data/.gitignore +0 -22
- data/.travis.yml +0 -20
- data/Appraisals +0 -15
- data/Gemfile +0 -2
- data/gemfiles/sidekiq_2.gemfile +0 -7
- data/gemfiles/sidekiq_3.gemfile +0 -7
- data/gemfiles/sidekiq_4.gemfile +0 -7
- data/gemfiles/sidekiq_5.gemfile +0 -7
- data/sidekiq-lock.gemspec +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 592d4bf95b4bbd2cba2444898c5f6843c0a9112c6c45e018999af361b8a5ca73
|
4
|
+
data.tar.gz: 7b0a5614796a292af28fc0880915a76ac85ecfb8c669b07d57d5019d8f246342
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff115e3d009c6b6803e20326c2d84bf2286d9e4b652fe840b743596b8257919d7c54b3f1b9e1dcf2f9f1cba16af6541490464a77d55b52ff1b9407f28a7981f3
|
7
|
+
data.tar.gz: 0cf165b35136db26001b236837dcd7a831867fc81d8b81a3e14c2efe76edf41ade9cb5ba437b311b9ec1626af5aae176a3a09fde0c393ef5b949f2f5e5f8fa64
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 0.5.0 (August 13, 2021)
|
2
|
+
|
3
|
+
- maintenance - test on latest ruby versions (remove outdated rubies from build), add sidekiq 6 to build matrix, remove coveralls
|
4
|
+
- fix for ruby 3 (thanks to [@ak15](https://github.com/ak15))
|
5
|
+
|
1
6
|
## 0.4.0 (July 18, 2018)
|
2
7
|
|
3
8
|
- make lock container configurable (non breaking change) - in case you would like to something else than `Thread.current` - now you easily can
|
@@ -10,7 +15,7 @@
|
|
10
15
|
|
11
16
|
## 0.3.0 (July 28, 2016)
|
12
17
|
|
13
|
-
- ability to set custom lock value. Works just like setting timeout and name
|
18
|
+
- ability to set custom lock value. Works just like setting timeout and name, handles procs as well (thanks to [@piokaczm](https://github.com/piokaczm))
|
14
19
|
|
15
20
|
``` ruby
|
16
21
|
sidekiq_options lock: {
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
<p align="center">
|
2
|
+
<img width="300" height="210" src="https://github.com/emq/sidekiq-lock/raw/master/logo.png">
|
3
|
+
</p>
|
4
|
+
|
1
5
|
# Sidekiq::Lock
|
2
6
|
|
3
7
|
[![Code Climate](https://codeclimate.com/github/emq/sidekiq-lock.png)](https://codeclimate.com/github/emq/sidekiq-lock)
|
4
|
-
[![Build Status](https://travis-ci.
|
5
|
-
[![Coverage Status](https://coveralls.io/repos/emq/sidekiq-lock/badge.png)](https://coveralls.io/r/emq/sidekiq-lock)
|
8
|
+
[![Build Status](https://travis-ci.com/rwojsznis/sidekiq-lock.svg?branch=master)](https://travis-ci.com/rwojsznis/sidekiq-lock)
|
6
9
|
[![Gem Version](https://badge.fury.io/rb/sidekiq-lock.png)](http://badge.fury.io/rb/sidekiq-lock)
|
7
10
|
|
8
11
|
**Note:** This is a _complete_ piece of software, it should work across all future sidekiq & ruby versions.
|
@@ -23,7 +23,7 @@ module Sidekiq
|
|
23
23
|
# this also requires redis-rb >= 3.0.5
|
24
24
|
def acquire!
|
25
25
|
@acquired ||= Sidekiq.redis do |r|
|
26
|
-
r.set(name, value,
|
26
|
+
r.set(name, value, nx: true, px: timeout)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -31,8 +31,8 @@ module Sidekiq
|
|
31
31
|
Sidekiq.redis do |r|
|
32
32
|
begin
|
33
33
|
r.evalsha redis_lock_script_sha, keys: [name], argv: [value]
|
34
|
-
|
35
|
-
|
34
|
+
rescue Redis::CommandError
|
35
|
+
r.eval redis_lock_script, keys: [name], argv: [value]
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
data/lib/sidekiq/lock/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-lock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafal Wojsznis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: coveralls
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0.8'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0.8'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: mocha
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,18 +129,10 @@ executables: []
|
|
143
129
|
extensions: []
|
144
130
|
extra_rdoc_files: []
|
145
131
|
files:
|
146
|
-
- ".gitignore"
|
147
|
-
- ".travis.yml"
|
148
|
-
- Appraisals
|
149
132
|
- CHANGELOG.md
|
150
|
-
- Gemfile
|
151
133
|
- LICENSE.txt
|
152
134
|
- README.md
|
153
135
|
- Rakefile
|
154
|
-
- gemfiles/sidekiq_2.gemfile
|
155
|
-
- gemfiles/sidekiq_3.gemfile
|
156
|
-
- gemfiles/sidekiq_4.gemfile
|
157
|
-
- gemfiles/sidekiq_5.gemfile
|
158
136
|
- lib/sidekiq-lock.rb
|
159
137
|
- lib/sidekiq/lock.rb
|
160
138
|
- lib/sidekiq/lock/container.rb
|
@@ -163,7 +141,6 @@ files:
|
|
163
141
|
- lib/sidekiq/lock/testing/inline.rb
|
164
142
|
- lib/sidekiq/lock/version.rb
|
165
143
|
- lib/sidekiq/lock/worker.rb
|
166
|
-
- sidekiq-lock.gemspec
|
167
144
|
- test/lib/container_test.rb
|
168
145
|
- test/lib/lock_test.rb
|
169
146
|
- test/lib/middleware_test.rb
|
@@ -191,17 +168,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
168
|
- !ruby/object:Gem::Version
|
192
169
|
version: '0'
|
193
170
|
requirements: []
|
194
|
-
|
195
|
-
rubygems_version: 2.7.6
|
171
|
+
rubygems_version: 3.2.5
|
196
172
|
signing_key:
|
197
173
|
specification_version: 4
|
198
174
|
summary: Simple redis-based lock mechanism for your sidekiq workers
|
199
175
|
test_files:
|
200
|
-
- test/
|
201
|
-
- test/lib/
|
202
|
-
- test/lib/middleware_test.rb
|
176
|
+
- test/test_workers.rb
|
177
|
+
- test/lib/worker_test.rb
|
203
178
|
- test/lib/redis_lock_test.rb
|
204
179
|
- test/lib/testing/inline_test.rb
|
205
|
-
- test/lib/
|
180
|
+
- test/lib/middleware_test.rb
|
181
|
+
- test/lib/lock_test.rb
|
182
|
+
- test/lib/container_test.rb
|
206
183
|
- test/test_helper.rb
|
207
|
-
- test/test_workers.rb
|
data/.gitignore
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
.rvmrc
|
19
|
-
.ruby-version
|
20
|
-
.ruby-gemset
|
21
|
-
*.gemfile.lock
|
22
|
-
.idea/
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
|
4
|
-
services:
|
5
|
-
- redis-server
|
6
|
-
|
7
|
-
gemfile:
|
8
|
-
- gemfiles/sidekiq_2.gemfile
|
9
|
-
- gemfiles/sidekiq_3.gemfile
|
10
|
-
- gemfiles/sidekiq_4.gemfile
|
11
|
-
- gemfiles/sidekiq_5.gemfile
|
12
|
-
|
13
|
-
rvm:
|
14
|
-
- 2.2.10
|
15
|
-
- 2.3.7
|
16
|
-
- 2.4.4
|
17
|
-
- 2.5.1
|
18
|
-
|
19
|
-
notifications:
|
20
|
-
email: false
|
data/Appraisals
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
appraise 'sidekiq-2' do
|
2
|
-
gem 'sidekiq', '~> 2.17', '>= 2.17.8'
|
3
|
-
end
|
4
|
-
|
5
|
-
appraise 'sidekiq-3' do
|
6
|
-
gem 'sidekiq', '~> 3.5', '>= 3.5.4'
|
7
|
-
end
|
8
|
-
|
9
|
-
appraise 'sidekiq-4' do
|
10
|
-
gem 'sidekiq', '~> 4.2', '>= 4.2.10'
|
11
|
-
end
|
12
|
-
|
13
|
-
appraise 'sidekiq-5' do
|
14
|
-
gem 'sidekiq', '~> 5.1', '>= 5.1'
|
15
|
-
end
|
data/Gemfile
DELETED
data/gemfiles/sidekiq_2.gemfile
DELETED
data/gemfiles/sidekiq_3.gemfile
DELETED
data/gemfiles/sidekiq_4.gemfile
DELETED
data/gemfiles/sidekiq_5.gemfile
DELETED
data/sidekiq-lock.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'sidekiq/lock/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "sidekiq-lock"
|
8
|
-
spec.version = Sidekiq::Lock::VERSION
|
9
|
-
spec.authors = ["Rafal Wojsznis"]
|
10
|
-
spec.email = ["rafal.wojsznis@gmail.com"]
|
11
|
-
spec.description = spec.summary = "Simple redis-based lock mechanism for your sidekiq workers"
|
12
|
-
spec.homepage = "https://github.com/emq/sidekiq-lock"
|
13
|
-
spec.license = "MIT"
|
14
|
-
|
15
|
-
spec.files = `git ls-files`.split($/)
|
16
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
-
spec.require_paths = ["lib"]
|
19
|
-
|
20
|
-
spec.add_dependency "sidekiq", ">= 2.14.0"
|
21
|
-
spec.add_dependency "redis", ">= 3.0.5"
|
22
|
-
|
23
|
-
spec.add_development_dependency "bundler"
|
24
|
-
spec.add_development_dependency "rake"
|
25
|
-
spec.add_development_dependency "rack-test"
|
26
|
-
spec.add_development_dependency "coveralls", "~> 0.8"
|
27
|
-
spec.add_development_dependency "mocha", "~> 0.14.0"
|
28
|
-
spec.add_development_dependency "minitest"
|
29
|
-
spec.add_development_dependency "appraisal"
|
30
|
-
end
|