| 54 | } |
| 55 | |
| 56 | void CronTask_AddStreamFinishedQueries() { |
| 57 | //-------------------------------------------------------------------------- |
| 58 | // add query logging task |
| 59 | //-------------------------------------------------------------------------- |
| 60 | |
| 61 | // make sure info tracking is enabled |
| 62 | bool info_enabled = false; |
| 63 | if(Config_Option_get(Config_CMD_INFO, &info_enabled) && info_enabled) { |
| 64 | RecurringTaskCtx *re_ctx = rm_malloc(sizeof(RecurringTaskCtx)); |
| 65 | re_ctx->new = CronTask_newStreamFinishedQueries; |
| 66 | re_ctx->task = CronTask_streamFinishedQueries; |
| 67 | re_ctx->free = rm_free; |
| 68 | re_ctx->when = 10; // 10ms from now |
| 69 | re_ctx->min_interval = 250; // 250ms |
| 70 | re_ctx->max_interval = 3000; // 3s |
| 71 | |
| 72 | // create task context |
| 73 | StreamFinishedQueryCtx *ctx = rm_malloc(sizeof(StreamFinishedQueryCtx)); |
| 74 | ctx->graph_idx = 0; |
| 75 | |
| 76 | re_ctx->ctx = ctx; |
| 77 | |
| 78 | // add recurring task |
| 79 | Cron_AddTask(0, CronTask_RecurringTask, CronTask_RecurringTaskFree, (void*)re_ctx); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | // add recurring tasks |
| 84 | void Cron_AddRecurringTasks(void) { |
no test coverage detected