Small performance tweaks for "item_store" as well.

This commit is contained in:
Michael Vogel 2016-10-07 06:05:43 +00:00
parent f9b9ee6b77
commit 6abac720e2
3 changed files with 49 additions and 43 deletions

View file

@ -128,8 +128,16 @@ function poller_run(&$argv, &$argc){
if (function_exists($funcname)) {
logger("Process ".$mypid." - Prio ".$r[0]["priority"]." - ID ".$r[0]["id"].": ".$funcname." ".$r[0]["parameter"]);
// For better logging create a new process id for every worker call
// But preserve the old one for the worker
$old_process_id = $a->process_id;
$a->process_id = uniqid("wrk", true);
$funcname($argv, $argc);
$a->process_id = $old_process_id;
if ($cooldown > 0) {
logger("Process ".$mypid." - Prio ".$r[0]["priority"]." - ID ".$r[0]["id"].": ".$funcname." - in cooldown for ".$cooldown." seconds");
sleep($cooldown);