aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2015-01-21 16:07:47 +1100
committerRedMatrix <info@friendica.com>2015-01-21 16:07:47 +1100
commitc78c1ab4b0fe5194caa4b2879780a905d7053509 (patch)
treebe476c723f7eed84b5d5cdb8089f79811f49b4de
parentd0258c0da2c76c54edc800d26f559a654f5366f8 (diff)
parent90fbfb313ee40735f7b8501fb6c5330a06aead5d (diff)
downloadvolse-hubzilla-c78c1ab4b0fe5194caa4b2879780a905d7053509.tar.gz
volse-hubzilla-c78c1ab4b0fe5194caa4b2879780a905d7053509.tar.bz2
volse-hubzilla-c78c1ab4b0fe5194caa4b2879780a905d7053509.zip
Merge pull request #872 from habeascodice/master
Rework directory server update selection query
-rw-r--r--include/poller.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/poller.php b/include/poller.php
index 896553a43..61b0881f4 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -389,7 +389,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 ( ud_flags & %d ) = 0 and ud_addr != '' and ( ud_last = '%s' OR ud_last > %s - INTERVAL %s ) group by ud_addr ",
+ $r = q("SELECT u.ud_addr, u.ud_id, u.ud_last FROM updates AS u INNER JOIN (SELECT ud_addr, max(ud_last) AS ud_last FROM updates WHERE ( ud_flags & %d ) = 0 AND ud_addr != '' AND ( ud_last = '%s' OR ud_last > %s - INTERVAL %s ) GROUP BY ud_addr) AS s ON s.ud_addr = u.ud_addr AND s.ud_last = u.ud_last ",
intval(UPDATE_FLAGS_UPDATED),
dbesc(NULL_DATE),
db_utcnow(), db_quoteinterval('7 DAY')