MCPcopy Create free account
hub / github.com/apache/cloudberry / CanStartTask

Function CanStartTask

src/backend/task/pg_cron.c:982–987  ·  view source on GitHub ↗

* CanStartTask determines whether a task is ready to be started because * it has pending runs and we are running less than MaxRunningTasks. */

Source from the content-addressed store, hash-verified

980 * it has pending runs and we are running less than MaxRunningTasks.
981 */
982static bool
983CanStartTask(CronTask *task)
984{
985 return task->state == CRON_TASK_WAITING && task->pendingRunCount > 0 &&
986 RunningTaskCount < max_running_tasks;
987}
988
989/*
990 * ManageCronTasks proceeds the state machines of the given list of tasks.

Callers 2

PollForTasksFunction · 0.85
ManageCronTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected