From ff26b4ed9b0ced11d648f0ddae6c12faf2c4888a Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Mon, 25 Feb 2019 17:34:58 +0100 Subject: [PATCH] DEV: Prevent warning about already initialized constant --- lib/distributed_mutex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/distributed_mutex.rb b/lib/distributed_mutex.rb index 0dc4b86047b..cf9d3c48c90 100644 --- a/lib/distributed_mutex.rb +++ b/lib/distributed_mutex.rb @@ -1,6 +1,6 @@ # Cross-process locking using Redis. class DistributedMutex - DEFAULT_VALIDITY = 60 + DEFAULT_VALIDITY ||= 60 def self.synchronize(key, redis: nil, validity: DEFAULT_VALIDITY, &blk) self.new(