ksconnect 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ksconnect/api/plugin/data.rb +3 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e73fc8b81285c9b42353b90f2bf7112513a4297
|
4
|
+
data.tar.gz: 0ca63750f36d6c17554c4fe3d5a4b3351ced40de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b33207d8014f3f85bf9734eeed62f82752d3ad30c695655ee19fab1e50dc6f8a0559e3e649d5c08122d4e6275c1a20c4aa4071b4ba7d987666caf736ec952fd
|
7
|
+
data.tar.gz: cb77c2bf2f59d06e9398794902750aeac88088581f9c7244ac57c186e64254b31141db1fd2770045238848d28f5b6d8db35f7b60258d957295385d698fa212fd
|
@@ -101,20 +101,16 @@ class KSConnect
|
|
101
101
|
id = redis.hget("#{@plugin_name}:#{@type}", @domain_name)
|
102
102
|
if id
|
103
103
|
@cache_uuid = id
|
104
|
-
|
104
|
+
elsif !@read_only
|
105
105
|
@cache_uuid = SecureRandom.uuid
|
106
106
|
raise "Race on setting data key failed." unless redis.hsetnx("#{@plugin_name}:#{@type}", @domain_name, @cache_uuid)
|
107
|
+
else
|
108
|
+
'_NO_DATA_KEY'
|
107
109
|
end
|
108
110
|
rescue Exception => e
|
109
111
|
if (tries -= 1).nonzero?
|
110
112
|
logger.warn e.message
|
111
113
|
retry
|
112
|
-
else
|
113
|
-
if @read_only
|
114
|
-
raise e # re-raise if can't get uuid after all tries
|
115
|
-
else
|
116
|
-
'_NO_DATA_KEY'
|
117
|
-
end
|
118
114
|
end
|
119
115
|
end
|
120
116
|
}
|