aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Cron.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-04-12 09:29:51 +0200
committerMario Vavti <mario@mariovavti.com>2023-04-12 09:29:51 +0200
commit7ce4175876ce13727432dc839938bb8e486ef406 (patch)
tree5128e5c5d13629628c0e50b4a91935cfeda44a20 /Zotlabs/Daemon/Cron.php
parent03bdbfa705ba490b0450f063753100557f5d8bae (diff)
downloadvolse-hubzilla-7ce4175876ce13727432dc839938bb8e486ef406.tar.gz
volse-hubzilla-7ce4175876ce13727432dc839938bb8e486ef406.tar.bz2
volse-hubzilla-7ce4175876ce13727432dc839938bb8e486ef406.zip
initial commit directory sync rewrite - should work but still requires lots of cleanup
Diffstat (limited to 'Zotlabs/Daemon/Cron.php')
-rw-r--r--Zotlabs/Daemon/Cron.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php
index 640f06102..caae0ce53 100644
--- a/Zotlabs/Daemon/Cron.php
+++ b/Zotlabs/Daemon/Cron.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libsync;
+use Zotlabs\Lib\Libzotdir;
class Cron {
@@ -35,6 +36,17 @@ class Cron {
logger('cron: start');
+ // If this is a directory server, request a sync with an upstream
+ // directory at least once a day, up to once every poll interval.
+ // Pull remote changes and push local changes.
+ // potential issue: how do we keep from creating an endless update loop?
+
+ $dirmode = get_config('system', 'directory_mode');
+
+ if ($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
+ Libzotdir::sync_directories($dirmode);
+ }
+
// run queue delivery process in the background
Master::Summon(array('Queue'));