redis_support 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/redis_support/locks.rb +8 -0
  2. metadata +3 -3
@@ -88,6 +88,14 @@ module RedisSupport
88
88
  redis.exists lock_key(locked_key)
89
89
  end
90
90
 
91
+ def is_redis_locked?( locked_key )
92
+ locked_until(locked_key) > Time.now.to_i
93
+ end
94
+
95
+ def locked_until(locked_key)
96
+ redis.get( lock_key(locked_key) ).to_i
97
+ end
98
+
91
99
  private
92
100
 
93
101
  def lock_key( key_to_lock )
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_support
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 15
10
- version: 0.0.15
9
+ - 16
10
+ version: 0.0.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian P O'Rourke