Allow cronjob.php to be called from web.
This commit is contained in:
parent
9f896babe5
commit
1bd79b27d6
13
cronjob.php
13
cronjob.php
@ -13,12 +13,17 @@ if (is_console()) {
|
||||
$limit = empty($options['limit']) ? LIMIT_ALL : (int)$options['limit'];
|
||||
$update_interval = empty($options['update-interval']) ? null : (int)$options['update-interval'];
|
||||
$call_interval = empty($options['call-interval']) ? null : (int)$options['call-interval'];
|
||||
} else {
|
||||
|
||||
if ($update_interval !== null && $call_interval !== null && $limit === LIMIT_ALL && $update_interval >= $call_interval) {
|
||||
$limit = empty($_GET['limit']) ? LIMIT_ALL : (int)$_GET['limit'];
|
||||
$update_interval = empty($_GET['update-interval']) ? null : (int)$_GET['update-interval'];
|
||||
$call_interval = empty($_GET['call-interval']) ? null : (int)$_GET['call-interval'];
|
||||
}
|
||||
|
||||
if ($update_interval !== null && $call_interval !== null && $limit === LIMIT_ALL && $update_interval >= $call_interval) {
|
||||
|
||||
$feeds_count = \PicoTools\singleton('db')->table('feeds')->count();
|
||||
$limit = ceil($feeds_count / ($update_interval / $call_interval)); // compute new limit
|
||||
}
|
||||
|
||||
Model\update_feeds($limit);
|
||||
}
|
||||
|
||||
Model\update_feeds($limit);
|
||||
|
Loading…
Reference in New Issue
Block a user