From 59094cda5166e58a451cb0372a59d8059cbacd6f Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 10 Feb 2014 20:38:26 -0800 Subject: reversed args in update_modtime, incorrect ud_guid and ud_hash --- include/poller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/poller.php') diff --git a/include/poller.php b/include/poller.php index 0dcec4c0f..76c82db09 100644 --- a/include/poller.php +++ b/include/poller.php @@ -64,7 +64,7 @@ function poller_run($argv, $argc){ $r = q("select channel_id from channel where channel_dirdate < UTC_TIMESTAMP() - INTERVAL 30 DAY"); if($r) { foreach($r as $rr) { - proc_run('php','include/directory.php',$rr['channel_id']); + proc_run('php','include/directory.php',$rr['channel_id'],'ping'); if($interval) @time_sleep_until(microtime(true) + (float) $interval); } -- cgit v1.2.3 From 2d9655627a0006dbf7d10afbbc2bcc0fdc2a3750 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 11 Feb 2014 20:14:45 +0000 Subject: Clear out old notifications in the poller. --- include/poller.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/poller.php') diff --git a/include/poller.php b/include/poller.php index 76c82db09..4d191b853 100644 --- a/include/poller.php +++ b/include/poller.php @@ -56,7 +56,11 @@ function poller_run($argv, $argc){ foreach($r as $rr) 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 // or dead entries. -- cgit v1.2.3 From d02529fde1ee9d7ecf317ae30abce666e1b33eb4 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 11 Feb 2014 14:19:20 -0800 Subject: implement a forced directory update mode where we unconditionally create a directory sync packet. This is needed to ensure that monthly directory pings are propagated to other directory servers so they can each prove for themselves whether or not an account is alive or dead. We do not trust other directories to provide us information beyond "look at this entry and decide for yourself" as doing otherwise would invite rogue directory manipulations. As this scheduled update occurs on all channels across all servers, we should also pick up refresh messages from all existing channel clones and these should also propagate out to all directory servers using the same mechanism (though perhaps not at the same time). --- include/poller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/poller.php') diff --git a/include/poller.php b/include/poller.php index 76c82db09..eba765278 100644 --- a/include/poller.php +++ b/include/poller.php @@ -64,7 +64,7 @@ function poller_run($argv, $argc){ $r = q("select channel_id from channel where channel_dirdate < UTC_TIMESTAMP() - INTERVAL 30 DAY"); if($r) { foreach($r as $rr) { - proc_run('php','include/directory.php',$rr['channel_id'],'ping'); + proc_run('php','include/directory.php',$rr['channel_id'],'force'); if($interval) @time_sleep_until(microtime(true) + (float) $interval); } -- cgit v1.2.3 From 9498ed17ab4d71d926c47d02f4c9ae2f97e1a1d1 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 11 Feb 2014 14:35:02 -0800 Subject: 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. --- include/poller.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include/poller.php') 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'); } -- cgit v1.2.3 From 7d4916ec714d834db3493c2fc12e76b0ffdb26b2 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 18 Feb 2014 15:17:18 -0800 Subject: service class downgrade to the default service class on account expiration if using a non-default service class and account has expired. --- include/poller.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'include/poller.php') diff --git a/include/poller.php b/include/poller.php index ce9b75eb3..1c6f68eab 100644 --- a/include/poller.php +++ b/include/poller.php @@ -32,16 +32,6 @@ function poller_run($argv, $argc){ proc_run('php',"include/queue.php"); - // expire any expired accounts - - q("UPDATE account - SET account_flags = (account_flags | %d) - where not (account_flags & %d) - and account_expires != '0000-00-00 00:00:00' - and account_expires < UTC_TIMESTAMP() ", - intval(ACCOUNT_EXPIRED), - intval(ACCOUNT_EXPIRED) - ); // expire any expired mail @@ -115,6 +105,9 @@ function poller_run($argv, $argc){ q("delete from notify where seen = 1 and date < UTC_TIMESTAMP() - INTERVAL 30 DAY"); + // expire any expired accounts + require_once('include/account.php'); + downgrade_accounts(); // If this is a directory server, request a sync with an upstream // directory at least once a day, up to once every poll interval. -- cgit v1.2.3