drupal/cron.php

21 lines
426 B
PHP

<?php
include_once "includes/common.inc";
function cron_run() {
global $repository;
$time = time();
$result = db_query("SELECT * FROM crons WHERE $time - timestamp > scheduled");
while ($task = db_fetch_object($result)) {
if ($repository[$task->module]["cron"]) $repository[$task->module]["cron"]();
}
db_query("UPDATE crons SET timestamp = $time WHERE $time - timestamp > scheduled");
}
cron_run();
?>