From: Michael Vogel Date: Sat, 2 Jul 2016 07:31:28 +0000 (+0200) Subject: Added the new function to the poller. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c549ae939cd424c18052efd31f2d25ff9073f05f;p=friendica.git Added the new function to the poller. --- diff --git a/include/dba.php b/include/dba.php index cae045d874..6ce095fc65 100644 --- a/include/dba.php +++ b/include/dba.php @@ -1,4 +1,5 @@ $max_processes) { - logger("Processcheck: Maximum number of processes for backend tasks (".$max_processes.") reached.", LOGGER_DEBUG); - return; - } - } + if ($a->max_processes_reached()) + return; if (poller_max_connections_reached()) return; @@ -74,16 +62,9 @@ function poller_run(&$argv, &$argc){ while ($r = q("SELECT * FROM `workerqueue` WHERE `executed` = '0000-00-00 00:00:00' ORDER BY `created` LIMIT 1")) { - // Log the type of database processes - $processlist = dbm::processlist(); - if ($processlist["amount"] != "") { - logger("Processcheck: Processes: ".$processlist["amount"]." - Processlist: ".$processlist["list"], LOGGER_DEBUG); - - if ($processlist["amount"] > $max_processes) { - logger("Processcheck: Maximum number of processes for backend tasks (".$max_processes.") reached.", LOGGER_DEBUG); - return; - } - } + // Constantly check the number of parallel database processes + if ($a->max_processes_reached()) + return; // Constantly check the number of available database connections to let the frontend be accessible at any time if (poller_max_connections_reached()) diff --git a/index.php b/index.php index d2d3ecec3a..cde267cd19 100644 --- a/index.php +++ b/index.php @@ -45,7 +45,6 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false */ require_once("include/dba.php"); -require_once("include/dbm.php"); if(!$install) { $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);