diff --git a/include/dba.php b/include/dba.php index 3e62da892..d310ad04c 100644 --- a/include/dba.php +++ b/include/dba.php @@ -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); diff --git a/include/poller.php b/include/poller.php index e0b83dd73..0c92d0087 100644 --- a/include/poller.php +++ b/include/poller.php @@ -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())); }