MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / CronTask_AddStreamFinishedQueries

Function CronTask_AddStreamFinishedQueries

src/cron/tasks.c:56–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void 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
84void Cron_AddRecurringTasks(void) {

Callers 2

Cron_AddRecurringTasksFunction · 0.85
reconf_handlerFunction · 0.85

Calls 3

Config_Option_getFunction · 0.85
rm_mallocFunction · 0.85
Cron_AddTaskFunction · 0.85

Tested by

no test coverage detected