diff options
author | Mario <mario@mariovavti.com> | 2021-01-15 15:48:17 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-01-15 15:48:17 +0000 |
commit | 43e36637217518601a2bc4421f750dba74f20222 (patch) | |
tree | ab63afa8864e49cddd369b1b5d992c9c30b4aab1 /Zotlabs/Daemon/Cron.php | |
parent | 9f8a512eb522b0c8ec2a2042945a626e74a6531f (diff) | |
download | volse-hubzilla-43e36637217518601a2bc4421f750dba74f20222.tar.gz volse-hubzilla-43e36637217518601a2bc4421f750dba74f20222.tar.bz2 volse-hubzilla-43e36637217518601a2bc4421f750dba74f20222.zip |
fix wrong/undefined variables and add sleep interval to notifier calls
Diffstat (limited to 'Zotlabs/Daemon/Cron.php')
-rw-r--r-- | Zotlabs/Daemon/Cron.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index 703d6ce08..1e65f6191 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -28,6 +28,7 @@ class Cron { } // Create a lockfile. Needs two vars, but $x doesn't need to contain anything. + $x = ''; file_put_contents($lockfile, $x); logger('cron: start'); @@ -54,6 +55,8 @@ class Cron { db_utcnow() ); + $interval = get_config('system','delivery_interval', 3); + // expire any expired items $r = q("select id,item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s @@ -67,6 +70,8 @@ class Cron { if($rr['item_wall']) { // The notifier isn't normally invoked unless item_drop is interactive. Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] ); + if($interval) + @time_sleep_until(microtime(true) + (float) $interval); } } } @@ -139,7 +144,7 @@ class Cron { ); if($x) { $z = q("select * from item where id = %d", - intval($message_id) + intval($rr['id']) ); if($z) { xchan_query($z); @@ -151,6 +156,8 @@ class Cron { ); } Master::Summon(array('Notifier','wall-new',$rr['id'])); + if($interval) + @time_sleep_until(microtime(true) + (float) $interval); } } } |