Handle deadlocks centrally

This commit is contained in:
Michael
2017-06-13 05:52:59 +00:00
parent 228993596a
commit 97be344a4a
2 changed files with 44 additions and 20 deletions

View File

@@ -194,10 +194,7 @@ function poller_execute($queue) {
if (!validate_include($include)) {
logger("Include file ".$argv[0]." is not valid!");
$timeout = 10;
while (!dba::delete('workerqueue', array('id' => $queue["id"])) && (--$timeout > 0)) {
sleep(1);
}
dba::delete('workerqueue', array('id' => $queue["id"]));
return true;
}
@@ -207,11 +204,7 @@ function poller_execute($queue) {
if (function_exists($funcname)) {
poller_exec_function($queue, $funcname, $argv);
$timeout = 10;
while (!dba::delete('workerqueue', array('id' => $queue["id"])) && (--$timeout > 0)) {
logger('Delete ID '.$queue["id"], LOGGER_DEBUG);
sleep(1);
}
dba::delete('workerqueue', array('id' => $queue["id"]));
} else {
logger("Function ".$funcname." does not exist");
}