DEV: Prevent warning about already initialized constant

DEV: Prevent warning about already initialized constant

diff --git a/lib/distributed_mutex.rb b/lib/distributed_mutex.rb
index 0dc4b86..cf9d3c4 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(

GitHub sha: ff26b4ed

1 Like