diff --git a/src/sw/redis++/recipes/redlock.h b/src/sw/redis++/recipes/redlock.h index 53a88f5f..5fcb21e6 100644 --- a/src/sw/redis++/recipes/redlock.h +++ b/src/sw/redis++/recipes/redlock.h @@ -286,7 +286,12 @@ class RedLockMutex const RedLockMutexVessel::LockInfo lock_info = {true, std::chrono::steady_clock::now(), ttl, _resource, random_string}; const auto result = _redlock_mutex.extend_lock(lock_info, ttl); - return result.time_remaining; + if (!result.locked) { + return std::chrono::milliseconds(-1); + } + else { + return result.time_remaining; + } } std::chrono::milliseconds extend_lock(const std::string &random_string,