aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/poller.php')
-rw-r--r--include/poller.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/include/poller.php b/include/poller.php
index 2ba86dc0b..c90e48d6b 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -35,12 +35,15 @@ function poller_run($argv, $argc){
// expire any expired mail
- q("delete from mail where expires != '0000-00-00 00:00:00' and expires < UTC_TIMESTAMP() ");
+ q("delete from mail where expires != '%s' and expires < UTC_TIMESTAMP() ",
+ dbesc(NULL_DATE)
+ );
// expire any expired items
- $r = q("select id from item where expires != '0000-00-00 00:00:00' and expires < UTC_TIMESTAMP()
+ $r = q("select id from item where expires != '%s' and expires < UTC_TIMESTAMP()
and not ( item_restrict & %d ) ",
+ dbesc(NULL_DATE),
intval(ITEM_DELETED)
);
if($r) {
@@ -151,7 +154,6 @@ 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
@@ -264,7 +266,9 @@ function poller_run($argv, $argc){
$c = $contact['abook_connected'];
if($contact['abook_flags'] & ABOOK_FLAG_FEED) {
- $min = intval(get_config('system','minimum_feedcheck_minutes'));
+ $min = service_class_fetch($contact['abook_channel'],'minimum_feedcheck_minutes');
+ if(! $min)
+ $min = intval(get_config('system','minimum_feedcheck_minutes'));
if(! $min)
$min = 60;
$x = datetime_convert('UTC','UTC',"now - $min minutes");
@@ -284,7 +288,7 @@ function poller_run($argv, $argc){
else {
// if we've never connected with them, start the mark for death countdown from now
- if($c == '0000-00-00 00:00:00') {
+ if($c == NULL_DATE) {
$r = q("update abook set abook_connected = '%s' where abook_id = %d limit 1",
dbesc(datetime_convert()),
intval($contact['abook_id'])
@@ -337,8 +341,9 @@ function poller_run($argv, $argc){
}
if($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
- $r = q("select distinct ud_addr, updates.* from updates where not ( ud_flags & %d ) and ud_addr != '' and ( ud_last = '0000-00-00 00:00:00' OR ud_last > UTC_TIMESTAMP() - INTERVAL 7 DAY ) group by ud_addr ",
- intval(UPDATE_FLAGS_UPDATED)
+ $r = q("select distinct ud_addr, updates.* from updates where not ( ud_flags & %d ) and ud_addr != '' and ( ud_last = '%s' OR ud_last > UTC_TIMESTAMP() - INTERVAL 7 DAY ) group by ud_addr ",
+ intval(UPDATE_FLAGS_UPDATED),
+ dbesc(NULL_DATE)
);
if($r) {
foreach($r as $rr) {
@@ -346,7 +351,7 @@ function poller_run($argv, $argc){
// If they didn't respond when we attempted before, back off to once a day
// After 7 days we won't bother anymore
- if($rr['ud_last'] != '0000-00-00 00:00:00')
+ if($rr['ud_last'] != NULL_DATE)
if($rr['ud_last'] > datetime_convert('UTC','UTC', 'now - 1 day'))
continue;
proc_run('php','include/onedirsync.php',$rr['ud_id']);