activejob-lockable 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -0
- data/README.md +1 -1
- data/lib/activejob/lockable/lockable.rb +6 -0
- data/lib/activejob/lockable/redis_store.rb +4 -0
- data/lib/activejob/lockable/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00d85e35a9333dc6aff62522868ca06ae5b232da
|
4
|
+
data.tar.gz: 2e37ff7e727e2b1e52b1bddfeb109a986db42318
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7867247ae9ee03903cb36cf9f91c0b18d892808457d16ccfc214be3189c7190d98ae841a37c8f8b2bc547760d08f6f757654ff5f5889105704dc19dec82ffa1
|
7
|
+
data.tar.gz: 680c8b7980c7bc5c6651a0ca924551638a8277aa6a4e226c36cf79ce2c8641ae606d694c90b1a6f478edb5224806a16847d247ec957c8a3c3d3878159fb2fbdc
|
data/.travis.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
rvm:
|
4
|
+
- 2.4.2
|
5
|
+
deploy:
|
6
|
+
skip_cleanup: true
|
7
|
+
provider: rubygems
|
8
|
+
api_key:
|
9
|
+
secure: aD0lrk/+PZnWSJVdDRHFB6kzea1dmJl1nlWXMsyr0s5FlXPGuF1O01LEJIxQSNhl2AiA/yQBbT/ldcEsYyzYvRJWlkXbzzfTNa3pl0MYM3U7lDfAA9oJn2Xis/jiW7pI+vEehIA+6V5rr/V1KBNrxxveWQhcpfiQi7p6efF/XBugCqNhVW8G/NLN2S2Zi5ITFekAHoubYh1h0stFqnt9pxKLlm3eTBjs77DsMtLZtoy5KIMptRCOxTSOGteqFy/saeDWEPTWJWaKZ6zJ4bCQG15WJIJ+J+zcCO3kTD+hZUGkOgsy/lYuwOPu845f16kstPVBkqbcxbCdrQaI5sgwwdGNLF14yzwFS8c309ZC9Wnx6QsfPdQjV6Ol4ZTufVqi3EMEmvJQ78gX2T3J8E/6Cer4Ay2vrny5SyzekFSbGcMPr++iGk4JVn/jgEulAxMvDJoqdrJhETCKAcPlk1EesPUPP5JuXuW6HfDXNEYvv7Bzo2xVuaUsNvSMLsbZai7E2PchkBYApIKg9A6hFkt7ymiAIszMiSDuIj90aBtKpOIoMw6TyRp/x0qXJkPw2UOO22YJHeJanEjKtc2jk3r65FPCRKna3GcHXBXGAcJTKP2fJdBcRKtB7Y/SjRq84uDZJxwNKRBfyCittpMuu20uln+ylQzE9hnM28O7dOUfNBs=
|
10
|
+
gem: activejob-lockable
|
11
|
+
on:
|
12
|
+
tags: true
|
13
|
+
repo: qonto/activejob-lockable
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ActiveJob::Lockable
|
1
|
+
# ActiveJob::Lockable [![Build Status](https://travis-ci.org/qonto/activejob-lockable.svg?branch=master)](https://travis-ci.org/qonto/activejob-lockable)
|
2
2
|
|
3
3
|
Gem to make to make jobs lockable. Useful when a job is called N times, but only a single execution is needed.
|
4
4
|
|
@@ -36,6 +36,12 @@ module ActiveJob
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def unlock!
|
40
|
+
return unless locked?
|
41
|
+
logger.info "unlocked with #{lock_key}. Job_id: #{self.job_id} class_name: #{self.class}"
|
42
|
+
ActiveJob::Lockable::RedisStore.del(lock_key)
|
43
|
+
end
|
44
|
+
|
39
45
|
def lock_key
|
40
46
|
md5 = Digest::MD5.hexdigest(self.arguments.join)
|
41
47
|
"#{self.class.name.downcase}:#{md5}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activejob-lockable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmytro Zakharov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -117,6 +117,7 @@ extra_rdoc_files: []
|
|
117
117
|
files:
|
118
118
|
- ".gitignore"
|
119
119
|
- ".rspec"
|
120
|
+
- ".travis.yml"
|
120
121
|
- Gemfile
|
121
122
|
- LICENSE.txt
|
122
123
|
- README.md
|