From a10bdd8f0e436e8bb41430ca5d18fb2e1682773c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 1 Feb 2010 17:13:29 -0800 Subject: Add a task scheduling module. In the admin maintenance, create an event from an existing task. When the task becomes due, it will run depending on traffic to the web site. It uses the gallery_shutdown event to time slice the task. --- modules/scheduler/models/schedule.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 modules/scheduler/models/schedule.php (limited to 'modules/scheduler/models/schedule.php') diff --git a/modules/scheduler/models/schedule.php b/modules/scheduler/models/schedule.php new file mode 100644 index 00000000..b83b5738 --- /dev/null +++ b/modules/scheduler/models/schedule.php @@ -0,0 +1,33 @@ +join("schedules_tasks", "task.id", "schedules_tasks.task_id") + ->where("schedule_id", "=", $this->id) + ->find_all(); + } + + public function add_task($task) { + db::build() + ->insert("schedules_tasks", array("schedule_id" => $this->id,"task_id" => $task->id)) + ->execute(); + } +} -- cgit v1.2.3