Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
Tao He 2021-12-22 14:19:36 +08:00
parent 1f3c62301f
commit 2087c8cef0
1 changed files with 1 additions and 1 deletions

View File

@ -195,7 +195,7 @@ class etcd::Client::TokenAuthenticator {
return token_;
}
std::lock_guard<std::mutex> scoped_lock(mtx_);
if (!token_.empty()) {
if (force || (!token_.empty())) {
auto tp = std::chrono::system_clock::now();
if (force || std::chrono::duration_cast<std::chrono::seconds>(tp - updated_at).count()
> std::max(1, ttl_ - 3)) {