singleton-client-test 0.7.0.28 → 0.7.0.29

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
  SHA256:
3
- metadata.gz: d56e992042fd4e5633b41c3de989fd805a44978c696dd7b9692da4191e22b4d4
4
- data.tar.gz: 99bcb2f0d4e6e502f88c90a5ae27a12349e2af35ff8a2356d781e97e57b8af74
3
+ metadata.gz: 56c3f8abf44f8fd425c81ffa852171a0ce02fe75b4b4005c7cfb691de45baccf
4
+ data.tar.gz: cdf801d6908dff8e70012372cdf97502698e10215a0dd23d7688796efe0caad8
5
5
  SHA512:
6
- metadata.gz: 8f84668bb050779955dbafbb37dd5e2e41a4d793c18552f3c1a51725e906db03e7a13f098329d36596f71adebedf90159d5cc0a85344f8f0bd3c1bd46ca555c9
7
- data.tar.gz: 4e5f2b2a430b96ca92bd67c9381bfd043f8808a800da6950e5f2e855f860560e96e43ea6f80ef0f9651138026cda0cf7f6ae1f1b84a77b4ea1d0d5de05c0215d
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 "Has cache for key: " + key
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: singleton-client-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.28
4
+ version: 0.7.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware G11n Team