Fixes the -Werror for unused "continue_next": we just use it.

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
This commit is contained in:
Tao He 2021-01-11 20:47:11 +08:00
parent 6962030db8
commit cfb5cb89d3
1 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,10 @@ etcd::KeepAlive::~KeepAlive()
void etcd::KeepAlive::Cancel() void etcd::KeepAlive::Cancel()
{ {
if (!continue_next) {
return;
}
continue_next = false;
#ifndef NDEBUG #ifndef NDEBUG
{ {
std::ios::fmtflags os_flags (std::cout.flags()); std::ios::fmtflags os_flags (std::cout.flags());
@ -52,6 +56,9 @@ void etcd::KeepAlive::Cancel()
void etcd::KeepAlive::refresh() void etcd::KeepAlive::refresh()
{ {
if (!continue_next) {
return;
}
// minimal resolution: 1 second // minimal resolution: 1 second
int keepalive_ttl = std::max(ttl - 1, 1); int keepalive_ttl = std::max(ttl - 1, 1);
#ifndef NDEBUG #ifndef NDEBUG