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 private
def setnx_with_expiration(key, data) def setnx_with_expiration(key, data)
redis.set( options = {nx: true}
key, options[:ex] = expire_time.to_i if expire_time.to_i > 0
data,
{}.tap do |options| redis.set(key, data, **options)
options[:nx] = true
options[:ex] = expire_time.to_i if expire_time.to_i > 0
end
)
end end
def lock_key(key) def lock_key(key)