From 710eac403c851864b9532ef2717baafb2e7f46e8 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 20 Nov 2013 23:03:40 +0100 Subject: [PATCH] Cronish jobs by the minute. These run very often! Minutely will NOT necessarily run by the minute, because it depends on site visitors. Busy sites will be able to do this, but sites where the visitors (or search engine stuff or api calls) are more than a minute apart, the interval will be much larger. --- plugins/Cronish/CronishPlugin.php | 15 +++++++++++++++ plugins/Cronish/lib/cronish.php | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/Cronish/CronishPlugin.php b/plugins/Cronish/CronishPlugin.php index b0c0095542..0b17fd3660 100644 --- a/plugins/Cronish/CronishPlugin.php +++ b/plugins/Cronish/CronishPlugin.php @@ -1,6 +1,21 @@ + * @copyright 2013 Free Software Foundation, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://www.gnu.org/software/social/ + */ class CronishPlugin extends Plugin { + public function onCronMinutely() + { + common_debug('CRON: Running minutely cron job!'); + } + public function onCronHourly() { common_debug('CRON: Running hourly cron job!'); diff --git a/plugins/Cronish/lib/cronish.php b/plugins/Cronish/lib/cronish.php index c7d79eeb5f..5889b079f4 100644 --- a/plugins/Cronish/lib/cronish.php +++ b/plugins/Cronish/lib/cronish.php @@ -23,7 +23,8 @@ class Cronish */ public function callTimedEvents() { - $timers = array('hourly' => 3600, + $timers = array('minutely' => 60, // this is NOT guaranteed to run every minute (only on busy sites) + 'hourly' => 3600, 'daily' => 86400, 'weekly' => 604800);