aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2015-01-20 20:59:08 -0800
committerHabeas Codice <habeascodice@federated.social>2015-01-20 20:59:08 -0800
commit90fbfb313ee40735f7b8501fb6c5330a06aead5d (patch)
tree501d570b5557cab78c27e42c18b326f908a521b3 /include/poller.php
parent9028e6bd30d5e457c63365cffba693a071bd1e4e (diff)
downloadvolse-hubzilla-90fbfb313ee40735f7b8501fb6c5330a06aead5d.tar.gz
volse-hubzilla-90fbfb313ee40735f7b8501fb6c5330a06aead5d.tar.bz2
volse-hubzilla-90fbfb313ee40735f7b8501fb6c5330a06aead5d.zip
Rework directory server update selection query
Diffstat (limited to 'include/poller.php')
-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')