aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Cron_weekly.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-19 21:22:04 -0700
committerredmatrix <git@macgirvin.com>2016-05-19 21:22:04 -0700
commit39bc0664a773a97ccce276161739f217e3ba7449 (patch)
tree726fff23174f4972337ad8aae6b8ff6544264a8b /Zotlabs/Daemon/Cron_weekly.php
parent853322e7d2734ad459a4e5740f3f1806ed55532e (diff)
downloadvolse-hubzilla-39bc0664a773a97ccce276161739f217e3ba7449.tar.gz
volse-hubzilla-39bc0664a773a97ccce276161739f217e3ba7449.tar.bz2
volse-hubzilla-39bc0664a773a97ccce276161739f217e3ba7449.zip
Separate cron into periodic components and use that as the main interface for scheduled tasks instead of the quaint 'poller'.
Diffstat (limited to 'Zotlabs/Daemon/Cron_weekly.php')
-rw-r--r--Zotlabs/Daemon/Cron_weekly.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Cron_weekly.php b/Zotlabs/Daemon/Cron_weekly.php
new file mode 100644
index 000000000..dc781ad73
--- /dev/null
+++ b/Zotlabs/Daemon/Cron_weekly.php
@@ -0,0 +1,50 @@
+<?php
+
+namespace Zotlabs\Daemon;
+
+class Cron_weekly {
+
+ static public function run($argc,$argv) {
+
+ /**
+ * Cron Weekly
+ *
+ * Actions in the following block are executed once per day only on Sunday (once per week).
+ *
+ */
+
+ call_hooks('cron_weekly',datetime_convert());
+
+
+ z_check_cert();
+
+ require_once('include/hubloc.php');
+ prune_hub_reinstalls();
+
+ require_once('include/Contact.php');
+ mark_orphan_hubsxchans();
+
+
+ // get rid of really old poco records
+
+ q("delete from xlink where xlink_updated < %s - INTERVAL %s and xlink_static = 0 ",
+ db_utcnow(), db_quoteinterval('14 DAY')
+ );
+
+ $dirmode = intval(get_config('system','directory_mode'));
+ if($dirmode === DIRECTORY_MODE_SECONDARY || $dirmode === DIRECTORY_MODE_PRIMARY) {
+ logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())),true));
+ }
+
+ // Check for dead sites
+ Master::Summon(array('Checksites'));
+
+ // update searchable doc indexes
+ Master::Summon(array('Importdoc'));
+
+ /**
+ * End Cron Weekly
+ */
+
+ }
+} \ No newline at end of file