$o = $w->object();
- $this->log("$w->id : $w->person_id_email email : ".
+ $this->logecho("$w->id : $w->person_id_email email : ".
$o->toEventString()." ". $w->status() );
}
exit;
while (true) {
- $this->log("BATCH SIZE: ". count($ar) );
+ $this->logecho("BATCH SIZE: ". count($ar) );
if (empty($ar)) {
- $this->log("COMPLETED MAIN QUEUE - running delated");
+ $this->logecho("COMPLETED MAIN QUEUE - running delated");
if (empty($pushed)) {
break;
$pipe = array();
- $this->log("call proc_open $cmd");
+ $this->logecho("call proc_open $cmd");
if ($this->max_pool_size === 1) {
if (!empty($this->opts['dryrun'])) {
- $this->log("DRY RUN");
+ $this->logecho("DRY RUN");
return;
}
);
- $this->log("RUN ({$info['pid']}) $cmd ");
+ $this->logecho("RUN ({$info['pid']}) $cmd ");
}
function poolfree()
// update if necessday.
if ($info['pid'] && $p['pid'] != $info['pid']) {
- $this->log("CHANING PID FROM " . $p['pid'] . " TO ". $info['pid']);
+ $this->logecho("CHANING PID FROM " . $p['pid'] . " TO ". $info['pid']);
$p['pid'] = $info['pid'];
}
//fclose($p['pipes'][1]);
fclose($p['pipes'][0]);
fclose($p['pipes'][2]);
- $this->log("TERMINATING: ({$p['pid']}) " . $p['cmd'] . " : " . file_get_contents($p['out']));
+ $this->logecho("TERMINATING: ({$p['pid']}) " . $p['cmd'] . " : " . file_get_contents($p['out']));
@unlink($p['out']);
continue;
// $pool[] = $p;
// continue;
//}
- $this->log("ENDED: ({$p['pid']}) " . $p['cmd'] . " : " . file_get_contents($p['out']) );
+ $this->logecho("ENDED: ({$p['pid']}) " . $p['cmd'] . " : " . file_get_contents($p['out']) );
@unlink($p['out']);
//unlink($p['out']);
}
- $this->log("POOL SIZE: ". count($pool) );
+ $this->logecho("POOL SIZE: ". count($pool) );
$this->pool = $pool;
if (count($pool) < $this->max_pool_size) {
return true;
{
die("Done\n");
}
- function log($str)
+ function logecho($str)
{
echo date("Y-m-d H:i:s - $str\n");
}