diff --git a/include/MySQL_HostGroups_Manager.h b/include/MySQL_HostGroups_Manager.h index b5d3cb854..2909522fe 100644 --- a/include/MySQL_HostGroups_Manager.h +++ b/include/MySQL_HostGroups_Manager.h @@ -316,7 +316,7 @@ class MyHGC { // MySQL Host Group Container public: unsigned int hid; std::atomic num_online_servers; - unsigned long long last_log_time_num_online_servers; + time_t last_log_time_num_online_servers; unsigned long long current_time_now; uint32_t new_connections_now; MySrvList *mysrvs; diff --git a/lib/MyHGC.cpp b/lib/MyHGC.cpp index 9919683cb..66f296fd9 100644 --- a/lib/MyHGC.cpp +++ b/lib/MyHGC.cpp @@ -410,10 +410,10 @@ void MyHGC::refresh_online_server_count() { } void MyHGC::log_num_online_server_count_error() { - const unsigned long long curtime = monotonic_time(); + const time_t curtime = time(NULL); // if this is the first time the method is called or if more than 10 seconds have passed since the last log if (last_log_time_num_online_servers == 0 || - (curtime - last_log_time_num_online_servers > 10 * 1000 * 1000)) { + ((curtime - last_log_time_num_online_servers) > 10)) { last_log_time_num_online_servers = curtime; proxy_error( "Number of online servers detected in a hostgroup exceeds the configured maximum online servers. hostgroup:%u, num_online_servers:%u, max_online_servers:%u\n",