aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-11 14:35:02 -0800
committerfriendica <info@friendica.com>2014-02-11 14:35:02 -0800
commit9498ed17ab4d71d926c47d02f4c9ae2f97e1a1d1 (patch)
tree577319224b376a87ca8c4e0dbce89612562c5b37
parentc0e1e7ed2c46b0c2e86eeeaa6c62f10f35f93b51 (diff)
downloadvolse-hubzilla-9498ed17ab4d71d926c47d02f4c9ae2f97e1a1d1.tar.gz
volse-hubzilla-9498ed17ab4d71d926c47d02f4c9ae2f97e1a1d1.tar.bz2
volse-hubzilla-9498ed17ab4d71d926c47d02f4c9ae2f97e1a1d1.zip
move expiration of notifications to the equivalent of "cron daily" to try and reduce the number of things the poller has to do on every run.
-rw-r--r--include/poller.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/include/poller.php b/include/poller.php
index f75ba2f22..ce9b75eb3 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -47,6 +47,8 @@ function poller_run($argv, $argc){
q("delete from mail where expires != '0000-00-00 00:00:00' and expires < UTC_TIMESTAMP() ");
+ // expire any expired items
+
$r = q("select id from item where expires != '0000-00-00 00:00:00' and expires < UTC_TIMESTAMP()
and not ( item_restrict & %d ) ",
intval(ITEM_DELETED)
@@ -57,9 +59,6 @@ function poller_run($argv, $argc){
drop_item($rr['id'],false);
}
- // expire any read notifications over a month old
-
- q("delete from notify where seen = 1 and date < UTC_TIMESTAMP() - INTERVAL 30 DAY");
// Ensure that every channel pings a directory server once a month. This way we can discover
// channels and sites that quietly vanished and prevent the directory from accumulating stale
@@ -107,8 +106,16 @@ function poller_run($argv, $argc){
$dirmode = get_config('system','directory_mode');
+
+ // Actions in the following block are executed once per day, not on every poller run
+
if($d2 != intval($d1)) {
+ // expire any read notifications over a month old
+
+ q("delete from notify where seen = 1 and date < UTC_TIMESTAMP() - INTERVAL 30 DAY");
+
+
// 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.
@@ -119,14 +126,8 @@ function poller_run($argv, $argc){
sync_directories($dirmode);
}
-
set_config('system','last_expire_day',$d2);
-// Uncomment when expire protocol component is working
-// Update - this is not going to happen. We are only going to
-// implement per-item expire, not blanket expiration
-// proc_run('php','include/expire.php');
-
proc_run('php','include/cli_suggest.php');
}