aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-08 20:35:15 -0700
committerfriendica <info@friendica.com>2014-09-08 20:35:15 -0700
commitc6d07feff575862b5db8d05e02be6375e51034c7 (patch)
tree8d1bf75a545075753033c47ee28f4d4ae2a96517 /include/poller.php
parent8fbeb370db7d1ec16a2f221fb7f022aebe7be109 (diff)
downloadvolse-hubzilla-c6d07feff575862b5db8d05e02be6375e51034c7.tar.gz
volse-hubzilla-c6d07feff575862b5db8d05e02be6375e51034c7.tar.bz2
volse-hubzilla-c6d07feff575862b5db8d05e02be6375e51034c7.zip
This is long overdue - use a symblic constant NULL_DATE instead of the easily mis-typed sequence '0000-00-00 00:00:00'
Diffstat (limited to 'include/poller.php')
-rw-r--r--include/poller.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/poller.php b/include/poller.php
index b26b9e696..fe242d659 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -35,11 +35,11 @@ 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 != NULL_DATE 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()
+ $r = q("select id from item where expires != NULL_DATE and expires < UTC_TIMESTAMP()
and not ( item_restrict & %d ) ",
intval(ITEM_DELETED)
);
@@ -285,7 +285,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'])
@@ -338,7 +338,7 @@ 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 ",
+ $r = q("select distinct ud_addr, updates.* from updates where not ( ud_flags & %d ) and ud_addr != '' and ( ud_last = NULL_DATE OR ud_last > UTC_TIMESTAMP() - INTERVAL 7 DAY ) group by ud_addr ",
intval(UPDATE_FLAGS_UPDATED)
);
if($r) {
@@ -347,7 +347,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']);