]> git.mxchange.org Git - friendica.git/commitdiff
Update the last query at a single place
authorMichael <heluecht@pirati.ca>
Sat, 1 Aug 2020 08:56:07 +0000 (08:56 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 1 Aug 2020 08:56:07 +0000 (08:56 +0000)
src/Model/GServer.php
src/Protocol/PortableContact.php

index 9a8166158b67bcd04b024dcfe813cb61a006632d..07a5eaad3ec93374362c155bbfb1ff12555d25b4 100644 (file)
@@ -1607,11 +1607,12 @@ class GServer
                        Logger::info('Update peer list', ['server' => $gserver['url'], 'id' => $gserver['id']]);
                        Worker::add(PRIORITY_LOW, 'UpdateServerPeers', $gserver['url']);
 
-                       if ($gserver['directory-type'] == self::DT_POCO) {
-                               Logger::info('Update directory', ['server' => $gserver['url'], 'id' => $gserver['id']]);
-                               Worker::add(PRIORITY_LOW, 'UpdateServerDirectory', $gserver);
-                       }
+                       Logger::info('Update directory', ['server' => $gserver['url'], 'id' => $gserver['id']]);
+                       Worker::add(PRIORITY_LOW, 'UpdateServerDirectory', $gserver);
 
+                       $fields = ['last_poco_query' => DateTimeFormat::utcNow()];
+                       DBA::update('gserver', $fields, ['nurl' => $gserver['nurl']]);
+       
                        if (--$no_of_queries == 0) {
                                break;
                        }
index cfc140d66d9a45e03993010e1e29a6b2972ae3bf..8109ef23736ca0f22c2d6ab329310fd8be56df2f 100644 (file)
@@ -330,18 +330,11 @@ class PortableContact
                                }
                        }
 
-                       $fields = ['last_poco_query' => DateTimeFormat::utcNow()];
-                       DBA::update('gserver', $fields, ['nurl' => $server["nurl"]]);
-
                        return true;
                } else {
                        // If the server hadn't replied correctly, then force a sanity check
                        GServer::check($server["url"], $server["network"], true);
 
-                       // If we couldn't reach the server, we will try it some time later
-                       $fields = ['last_poco_query' => DateTimeFormat::utcNow()];
-                       DBA::update('gserver', $fields, ['nurl' => $server["nurl"]]);
-
                        return false;
                }
        }