You are here

protected function JobScheduler::reserve in Job Scheduler 7

Same name and namespace in other branches
  1. 7.2 JobScheduler.inc \JobScheduler::reserve()

Reserve a job.

1 call to JobScheduler::reserve()
JobScheduler::dispatch in ./JobScheduler.inc
Dispatches a job.

File

./JobScheduler.inc, line 96
JobScheduler class.

Class

JobScheduler
Manage scheduled jobs.

Code

protected function reserve($job) {
  $job['name'] = $this->name;
  $job['scheduled'] = $job['last'] = REQUEST_TIME;
  $job['next'] = $job['period'] + REQUEST_TIME;
  drupal_write_record('job_schedule', $job, array(
    'name',
    'type',
    'id',
  ));
}