aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-07-16 16:21:01 -0700
committerfriendica <info@friendica.com>2014-07-16 16:21:01 -0700
commitf11856f839994c00eae2fdffe3f6f7b21dcf87a3 (patch)
tree2efa28b762513249210397525703846f329721ac
parent3a31ddea2b516cebe60c6ac096516db8df101fd0 (diff)
downloadvolse-hubzilla-f11856f839994c00eae2fdffe3f6f7b21dcf87a3.tar.gz
volse-hubzilla-f11856f839994c00eae2fdffe3f6f7b21dcf87a3.tar.bz2
volse-hubzilla-f11856f839994c00eae2fdffe3f6f7b21dcf87a3.zip
allow a site to run cron daily at a chosen hour
-rw-r--r--include/poller.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/poller.php b/include/poller.php
index ec013c9c7..546a2d6d1 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -91,9 +91,15 @@ function poller_run($argv, $argc){
// FIXME: add birthday updates, both locally and for xprof for use
// by directory servers
- $d1 = get_config('system','last_expire_day');
+ $d1 = intval(get_config('system','last_expire_day'));
$d2 = intval(datetime_convert('UTC','UTC','now','d'));
+ // Allow somebody to staggger daily activities if they have more than one site on their server,
+ // or if it happens at an inconvenient (busy) hour.
+
+ $h1 = intval(get_config('system','cron_hour'));
+ $h2 = intval(datetime_convert('UTC','UTC','now','G'));
+
$dirmode = get_config('system','directory_mode');
/**
@@ -103,7 +109,7 @@ function poller_run($argv, $argc){
*
*/
- if($d2 != intval($d1)) {
+ if(($d2 != $d1) && ($h1 == $h2)) {
call_hooks('cron_daily',datetime_convert());
@@ -129,6 +135,10 @@ function poller_run($argv, $argc){
require_once('include/Contact.php');
mark_orphan_hubsxchans();
+
+ /**
+ * End Cron Weekly
+ */
}
update_birthdays();
@@ -156,6 +166,9 @@ function poller_run($argv, $argc){
proc_run('php','include/expire.php');
proc_run('php','include/cli_suggest.php');
+ /**
+ * End Cron Daily
+ */
}
// update any photos which didn't get imported properly
@@ -180,7 +193,8 @@ function poller_run($argv, $argc){
// pull in some public posts
- if(! get_config('system','disable_discover_tab'))
+
+ if(! get_config('system','disable_discover_tab'))
proc_run('php','include/externals.php');