etcd 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/etcd/mod/lock.rb +4 -4
- data/lib/etcd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTQyMjkyOGM4NDVjZDUxZjkxZTBlYmMyMzdlMjYwMDAyOGJiZGEwYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGY4MjJlZGJhODY1NTQ0YTA1YjkxYmNhYmJiNDI2ZGVhMDMxMTZhYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDc5NmZkOTAwZGNhZjNkMjBmMTM3NWRmYTViYzE3YTkyMWY3Yzc3NjcxYjRi
|
10
|
+
OWVmZDZkNWE3MzdjNWJhODgzN2RhZDg0NThhZWFiOTUxY2Y5ODU5MGE5NzJj
|
11
|
+
NWRhZWJjZmNlM2IyNDJlNjBkZDVkZjYwZjgzNzEwMTY1NzhiOGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njc1NGI2NWUyZGEzMWZhMmU0M2JkYjdiNDFmMWNkNzUxYTQ2YzI4NjFiNmVh
|
14
|
+
NjBjYjcyNDBlMzczODg3YzcyNmZkNTllZTY0Y2UxMWM1ODU2ZDBlNzI5Y2M1
|
15
|
+
NDJkNzAzYTZjYzlmNzRkY2E1OWI4NWI3ZmZkNjI3YWY3MTg4NDM=
|
data/lib/etcd/mod/lock.rb
CHANGED
@@ -14,7 +14,7 @@ module Etcd
|
|
14
14
|
path = mod_lock_endpoint + key + "?ttl=#{ttl}"
|
15
15
|
timeout = opts[:timeout] || 60
|
16
16
|
Timeout.timeout(timeout) do
|
17
|
-
api_execute(path, :post, params: opts)
|
17
|
+
return api_execute(path, :post, params: opts).body
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -42,14 +42,14 @@ module Etcd
|
|
42
42
|
|
43
43
|
# rubocop:disable RescueException
|
44
44
|
def lock(key, ttl, opts = {})
|
45
|
-
|
46
|
-
|
45
|
+
key = "/" + key unless key.start_with? '/'
|
46
|
+
lock_index = acquire_lock(key, ttl, opts)
|
47
47
|
begin
|
48
48
|
yield key
|
49
49
|
rescue Exception => e
|
50
50
|
raise e
|
51
51
|
ensure
|
52
|
-
delete_lock(key, index:
|
52
|
+
delete_lock(key, index: lock_index)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
# rubocop:enable RescueException
|
data/lib/etcd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etcd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ranjib Dey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-log
|