singleton-client-test 0.7.0.28 → 0.7.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sgtn-client/api/translation.rb +3 -3
- data/lib/sgtn-client/core/cache.rb +2 -2
- data/lib/sgtn-client/util/cache-util.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 56c3f8abf44f8fd425c81ffa852171a0ce02fe75b4b4005c7cfb691de45baccf
|
|
4
|
+
data.tar.gz: cdf801d6908dff8e70012372cdf97502698e10215a0dd23d7688796efe0caad8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5c32aed4ff94f04c7413a07f2c4ab1f113216cbc59bfff3e82e88211a8ea052defec92e1fb132e283b4dd21bf3e1a50d053a69a42a33679f320d2d509741d1a
|
|
7
|
+
data.tar.gz: c2bd59d99dfa74e05c8bb882eac12b78ae7ae5f792136aae08a8fae41afb8f091d64715aa16b52e492dcd176c9611cd923e113dc822840fa0563d95d1d2703e4
|
|
@@ -16,7 +16,7 @@ module SgtnClient
|
|
|
16
16
|
if str.nil?
|
|
17
17
|
str = SgtnClient::Source.getSource(component, key, SgtnClient::Config.configurations.default)
|
|
18
18
|
if str.nil?
|
|
19
|
-
SgtnClient.logger.error "Can't find the key " + key + " in source path!"
|
|
19
|
+
SgtnClient.logger.error "Can't find the key '" + key + "' in source path!"
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
str
|
|
@@ -27,7 +27,7 @@ module SgtnClient
|
|
|
27
27
|
if str.nil?
|
|
28
28
|
str = SgtnClient::Source.getSource(component, key, SgtnClient::Config.configurations.default)
|
|
29
29
|
if str.nil?
|
|
30
|
-
SgtnClient.logger.error "Can't find the key " + key + " in source path!"
|
|
30
|
+
SgtnClient.logger.error "Can't find the key '" + key + "' in source path!"
|
|
31
31
|
return nil
|
|
32
32
|
end
|
|
33
33
|
str.to_plural_s(:en, plural_args)
|
|
@@ -58,7 +58,7 @@ module SgtnClient
|
|
|
58
58
|
items = {}
|
|
59
59
|
s = SgtnClient::Source.getSources(component, default)
|
|
60
60
|
if s.nil?
|
|
61
|
-
SgtnClient.logger.error "Can't find the component " + component + " in source path!"
|
|
61
|
+
SgtnClient.logger.error "Can't find the component '" + component + "' in source path!"
|
|
62
62
|
else
|
|
63
63
|
default_component, value = s.first
|
|
64
64
|
items["component"] = component
|
|
@@ -37,13 +37,13 @@ module SgtnClient::Core
|
|
|
37
37
|
if @@data == nil
|
|
38
38
|
return nil
|
|
39
39
|
end
|
|
40
|
-
SgtnClient.logger.debug "
|
|
40
|
+
SgtnClient.logger.debug "Check if the cache has key: #{(@@data.has_key? key)}"
|
|
41
41
|
@@data.has_key? key
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def self.put(key, value, ttl=nil)
|
|
45
45
|
@mutex.synchronize do
|
|
46
|
-
if @@data == nil
|
|
46
|
+
if @@data == nil || value == nil
|
|
47
47
|
return nil
|
|
48
48
|
end
|
|
49
49
|
ttl ||= @@opts[:ttl]
|
|
@@ -19,6 +19,10 @@ module SgtnClient
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def self.write_cache(cache_key, items)
|
|
22
|
+
if items.nil?
|
|
23
|
+
SgtnClient.logger.debug "write cache with key #{cache_key}, itmes #{items}"
|
|
24
|
+
return nil
|
|
25
|
+
end
|
|
22
26
|
env = SgtnClient::Config.default_environment
|
|
23
27
|
cache_expiry_period = SgtnClient::Config.configurations[env]["cache_expiry_period"]
|
|
24
28
|
# expired after 24 hours
|