Start housekeeper before services

The housekeeper needs to be initialized before services are started.
This commit is contained in:
Markus Mäkelä
2018-04-24 10:23:32 +03:00
parent a7df6b55d5
commit ce98831908
3 changed files with 17 additions and 12 deletions

View File

@ -256,12 +256,14 @@ json_t* Housekeeper::tasks_json(const char* host)
void hktask_add(const char *name, TASKFN func, void *data, int frequency)
{
ss_dassert(hk);
Task task(name, func, data, frequency);
hk->add(task);
}
void hktask_remove(const char *name)
{
ss_dassert(hk);
hk->remove(name);
}
@ -293,6 +295,7 @@ bool hkinit()
void hkshutdown()
{
ss_dassert(hk);
hk->stop();
}
@ -306,10 +309,12 @@ void hkfinish()
void hkshow_tasks(DCB *pDcb)
{
ss_dassert(hk);
hk->print_tasks(pDcb);
}
json_t* hk_tasks_json(const char* host)
{
ss_dassert(hk);
return hk->tasks_json(host);
}