Moved common functions to monitor_common.c

This commit is contained in:
Markus Makela
2015-05-09 14:29:26 +03:00
parent 8af302d785
commit 0c15812340
7 changed files with 63 additions and 127 deletions

View File

@ -122,7 +122,7 @@ CONFIG_PARAMETER* params = (CONFIG_PARAMETER*)opt;
spinlock_init(&handle->lock);
}
handle->tid = (THREAD)thread_start(monitorMain, handle);
handle->tid = (THREAD)thread_start(monitorMain, mon);
return handle;
}
@ -356,10 +356,10 @@ size_t nrounds = 0;
while (ptr)
{
unsigned int prev_status = ptr->server->status;
ptr->mon_prev_status = ptr->server->status;
monitorDatabase(ptr, mon->user, mon->password,mon);
if (ptr->server->status != prev_status ||
if (ptr->server->status != ptr->mon_prev_status ||
SERVER_IS_DOWN(ptr->server))
{
LOGIF(LD, (skygw_log_write_flush(