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

Function Cron_AbortTask

src/cron/cron.c:287–309  ·  view source on GitHub ↗

tries to abort given task in case task is currently being executed, it will wait for it to finish

Source from the content-addressed store, hash-verified

285// tries to abort given task
286// in case task is currently being executed, it will wait for it to finish
287bool Cron_AbortTask
288(
289 CronTaskHandle t // task to abort
290) {
291 ASSERT(cron != NULL);
292
293 CRON_TASK *task = (CRON_TASK *)t;
294
295 // try remove the task
296 if(!CRON_RemoveTask(task)) {
297 // in case task is currently being performed, wait for it to finish
298 while (cron->current_task == task) { }
299
300 // task wan't aborted
301 return false;
302 }
303
304 // free task
305 CRON_FreeTask(task);
306
307 // managed to abort task
308 return true;
309}
310

Callers 6

abort_and_check_timeoutFunction · 0.85
test_cronAbortFunction · 0.85
test_cronLateAbortFunction · 0.85
test_MultiAbortFunction · 0.85
test_AbortRunningTaskFunction · 0.85

Calls 2

CRON_RemoveTaskFunction · 0.85
CRON_FreeTaskFunction · 0.85

Tested by 5

test_cronAbortFunction · 0.68
test_cronLateAbortFunction · 0.68
test_MultiAbortFunction · 0.68
test_AbortRunningTaskFunction · 0.68