Changed timeout, logging added

This commit is contained in:
Michael 2017-06-13 09:03:19 +00:00
parent cd129665ef
commit e232c683b6
2 changed files with 6 additions and 2 deletions

View file

@ -675,8 +675,8 @@ class dba {
$args = func_get_args();
// In a case of a deadlock we are repeating the query 10 times
$timeout = 10;
// In a case of a deadlock we are repeating the query 20 times
$timeout = 20;
do {
$stmt = call_user_func_array('self::p', $args);

View file

@ -649,11 +649,15 @@ function find_worker_processes() {
*/
function poller_worker_process() {
$stamp = (float)microtime(true);
$timeout = 10;
do {
$found = find_worker_processes();
} while (!$found && (poller_total_entries() > 0) && (--$timeout > 0));
logger('Duration: '.number_format(microtime(true) - $stamp, 3), LOGGER_DEBUG);
if ($found) {
$r = q("SELECT * FROM `workerqueue` WHERE `pid` = %d", intval(getmypid()));
}