air18n 0.1.37 → 0.1.38

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.
@@ -28,7 +28,9 @@ module Air18n
28
28
 
29
29
  1.upto(num_chunks) do |i|
30
30
  chunk = value_json[(i-1)*MAX_CHUNK_SIZE, MAX_CHUNK_SIZE]
31
- result = cache.write(CHUNK_CACHE_KEY % [key, i], chunk, :expires_in => expires_in)
31
+ if cache.write(CHUNK_CACHE_KEY % [key, i], chunk, :expires_in => expires_in) == false
32
+ LoggingHelper.error "ChunkCache set: failed to write chunk #{CHUNK_CACHE_KEY % [key, i]} (#{chunk.size} bytes)"
33
+ end
32
34
  end
33
35
  end
34
36
 
@@ -39,7 +41,7 @@ module Air18n
39
41
  if chunk
40
42
  num_chunks, checksum = JSON.parse(chunk)
41
43
  else
42
- LoggingHelper.error("ChunkCache get: No checksum stored for #{key}")
44
+ LoggingHelper.error "ChunkCache get: no checksum stored for #{key}"
43
45
  return nil
44
46
  end
45
47
 
@@ -47,7 +49,8 @@ module Air18n
47
49
  chunk = cache.read(CHUNK_CACHE_KEY % [key, i])
48
50
 
49
51
  if chunk.nil?
50
- # Retrn nil if any chunk is missing.
52
+ # Return nil if any chunk is missing.
53
+ LoggingHelper.error "ChunkCache get: chunk #{CHUNK_CACHE_KEY % [key, i]} is missing"
51
54
  return nil
52
55
  end
53
56
 
@@ -55,7 +58,7 @@ module Air18n
55
58
  end
56
59
 
57
60
  if Zlib::crc32(buffer) != checksum
58
- LoggingHelper.error("ChunkCache get: Invalid checksum on #{key}")
61
+ LoggingHelper.error "ChunkCache get: invalid checksum for #{key}"
59
62
  return nil
60
63
  else
61
64
  return JSON.parse(buffer)[0]
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.1.37"
2
+ VERSION = "0.1.38"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.37
4
+ version: 0.1.38
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: