Skip to content

Commit

Permalink
Merge pull request #52 from Shopify/actually-not-compress-things
Browse files Browse the repository at this point in the history
Fix typo and never compress when reading an Entry's value
  • Loading branch information
maximebedard authored Oct 23, 2018
2 parents 9be6734 + bffe4c3 commit 1cae892
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/active_support/cache/memcached_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def escape_key(key)

def deserialize_entry(value)
if value
value.is_a?(Entry) ? value : Entry.new(value, compresss: false)
value.is_a?(Entry) ? value : Entry.new(value, compress: false)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/memcached_store/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# encoding: utf-8
module MemcachedStore
VERSION = "2.0.2"
VERSION = "2.0.3"
end
9 changes: 9 additions & 0 deletions test/test_memcached_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,15 @@ def test_raw_option_not_needed_on_read
assert_equal raw_data, @cache.read('raw')
end

def test_uncompress_regression
value = "bar" * ActiveSupport::Cache::Entry::DEFAULT_COMPRESS_LIMIT
Zlib::Deflate.expects(:deflate).never
Zlib::Inflate.expects(:inflate).never

@cache.write("foo", value, raw: true, compress: false)
assert_equal(value, @cache.read("foo"))
end

private

def assert_notifications(pattern, num)
Expand Down

0 comments on commit 1cae892

Please sign in to comment.