Merge pull request #6 from nickgrim/fix-2.7-warnings

Fix Ruby 2.7 warning
This commit is contained in:
Dmytro Zakharov 2021-05-07 16:23:47 +02:00 committed by GitHub
commit 22e73deadb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,14 +27,10 @@ module IdempotentRequest
private
def setnx_with_expiration(key, data)
redis.set(
key,
data,
{}.tap do |options|
options[:nx] = true
options[:ex] = expire_time.to_i if expire_time.to_i > 0
end
)
options = {nx: true}
options[:ex] = expire_time.to_i if expire_time.to_i > 0
redis.set(key, data, **options)
end
def lock_key(key)