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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b13ca8541fb112296178a39c09d9ef7fa8e3146
4
- data.tar.gz: 0fd8547b9e050bdaf2dea768ff3e4ed29920537e
3
+ metadata.gz: 00d85e35a9333dc6aff62522868ca06ae5b232da
4
+ data.tar.gz: 2e37ff7e727e2b1e52b1bddfeb109a986db42318
5
5
  SHA512:
6
- metadata.gz: 52ff57a0d672cb58afb292fd22c4e482396797e7b241d88e908290be7535d4217e1a0e22e8616ff900060e8215af20656b2a0c157b369d83a6348a498a5ad855
7
- data.tar.gz: 3237db29230609de7750f29926f40535722b51a38ffa6684fb247b163985a4ffb66aed0e4bebb9b6ebc74c43c761b839216ecf164c8613f7319250e05db02871
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}"
@@ -13,6 +13,10 @@ module ActiveJob
13
13
  def ttl(cache_key)
14
14
  ActiveJob::Lockable.redis.ttl(cache_key)
15
15
  end
16
+
17
+ def del(cache_key)
18
+ ActiveJob::Lockable.redis.del(cache_key)
19
+ end
16
20
  end
17
21
  end
18
22
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveJob
2
2
  module Lockable
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
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.3
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: 2017-11-13 00:00:00.000000000 Z
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