]> git.mxchange.org Git - friendica.git/commitdiff
Poller: The maximum number of connections can now be configured
authorMichael Vogel <icarus@dabo.de>
Tue, 9 Feb 2016 22:28:33 +0000 (23:28 +0100)
committerMichael Vogel <icarus@dabo.de>
Tue, 9 Feb 2016 22:28:33 +0000 (23:28 +0100)
include/dfrn.php
include/poller.php

index c4999a08e14b16ab66513b01798a49c5e0063082..6fa47af0524d38763b0b9fd4cebf1a831c0956bb 100644 (file)
@@ -1252,8 +1252,10 @@ class dfrn {
                         // Update check for this field has to be done differently
                        $datefields = array("name-date", "uri-date");
                        foreach ($datefields AS $field)
-                               if (strtotime($contact[$field]) > strtotime($r[0][$field]))
+                               if (strtotime($contact[$field]) > strtotime($r[0][$field])) {
+                                       logger("Difference for contact ".$contact["id"]." in field '".$field."'. Old value: '".$contact[$field]."', new value '".$r[0][$field]."'", LOGGER_DEBUG);
                                        $update = true;
+                               }
 
                        foreach ($fields AS $field => $data)
                                if ($contact[$field] != $r[0][$field]) {
index 712f6d5788da8b1f7272b0c9e2c62c1387a8d9b0..03f030771229e2b4cb7965777f4351e980b1ac2f 100644 (file)
@@ -130,9 +130,14 @@ function poller_max_connections_reached() {
        if (!$r)
                return false;
 
-       $max = intval($r[0]["Value"]);
-       if ($max == 0)
-               return false;
+       // Fetch the max value from the config. This is needed when the system cannot detect the correct value by itself.
+       $max = get_config("system", "max_connections");
+
+       if ($max == 0) {
+               $max = intval($r[0]["Value"]);
+               if ($max == 0)
+                       return false;
+       }
 
        $r = q("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
        if (!$r)