lib/redis_mutex.rb
def reset_expire(force = false)
    raise ExpireResetError, "reset_expire should be called only on locked resources" unless has_lock?
    # we've the lock so we can safely set the new expire time
    now = Time.now.to_f
    if force || (@expires_at < (now + (@expire / 2)))
      @expires_at = now + @expire
      set(@expires_at)
    end
  end
# Extends the expire time just in case process needs more time
Extends the expire time just in case process needs more time
Extends the expire time just in case process needs more time
def reset_expire(force = false)
    raise ExpireResetError, "reset_expire should be called only on locked resources" unless has_lock?
    now = Time.now.to_f
    if force || (@expires_at < (now + (@expire / 2)))
      @expires_at = now + @expire
      set(@expires_at)
    end
  end
def reset_expire ( force = false ) raise ExpireResetError , "reset_expire should be called only on locked resources" unless has_lock? now = Time . now . to_f if force || ( @expires_at < ( now + ( @expire / 2 ) ) ) @expires_at = now + @expire set ( @expires_at ) end end
Extends the expire time just in case process needs more time
Extends the expire time just in case process needs more time
# we've the lock so we can safely set the new expire time
force