Changed timeout, logging added
This commit is contained in:
parent
cd129665ef
commit
e232c683b6
|
@ -675,8 +675,8 @@ class dba {
|
||||||
|
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
|
||||||
// In a case of a deadlock we are repeating the query 10 times
|
// In a case of a deadlock we are repeating the query 20 times
|
||||||
$timeout = 10;
|
$timeout = 20;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$stmt = call_user_func_array('self::p', $args);
|
$stmt = call_user_func_array('self::p', $args);
|
||||||
|
|
|
@ -649,11 +649,15 @@ function find_worker_processes() {
|
||||||
*/
|
*/
|
||||||
function poller_worker_process() {
|
function poller_worker_process() {
|
||||||
|
|
||||||
|
$stamp = (float)microtime(true);
|
||||||
|
|
||||||
$timeout = 10;
|
$timeout = 10;
|
||||||
do {
|
do {
|
||||||
$found = find_worker_processes();
|
$found = find_worker_processes();
|
||||||
} while (!$found && (poller_total_entries() > 0) && (--$timeout > 0));
|
} while (!$found && (poller_total_entries() > 0) && (--$timeout > 0));
|
||||||
|
|
||||||
|
logger('Duration: '.number_format(microtime(true) - $stamp, 3), LOGGER_DEBUG);
|
||||||
|
|
||||||
if ($found) {
|
if ($found) {
|
||||||
$r = q("SELECT * FROM `workerqueue` WHERE `pid` = %d", intval(getmypid()));
|
$r = q("SELECT * FROM `workerqueue` WHERE `pid` = %d", intval(getmypid()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user