Skip to content

Commit

Permalink
Merge pull request #49974 from fatkodima/fix-redis-write_multi-with-e…
Browse files Browse the repository at this point in the history
…xpires_in

Fix `RedisCacheStore#write_multi` with `:expires_in`
  • Loading branch information
jonathanhefner committed Nov 8, 2023
2 parents 4162b12 + 096201f commit c36f877
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -386,7 +386,7 @@ def delete_multi_entries(entries, **_options)
end

# Nonstandard store provider API to write multiple values at once.
def write_multi_entries(entries, expires_in: nil, race_condition_ttl: nil, **options)
def write_multi_entries(entries, **options)
return if entries.empty?

failsafe :write_multi_entries do
Expand Down
9 changes: 9 additions & 0 deletions activesupport/test/cache/behaviors/cache_store_behavior.rb
Expand Up @@ -174,6 +174,15 @@ def test_write_multi_empty_hash
assert @cache.write_multi({})
end

def test_write_multi_expires_in
key = SecureRandom.uuid
@cache.write_multi({ key => 1 }, expires_in: 10)

travel(11.seconds) do
assert_nil @cache.read(key)
end
end

def test_fetch_multi
key = SecureRandom.uuid
other_key = SecureRandom.uuid
Expand Down

0 comments on commit c36f877

Please sign in to comment.