switch around how XMLStream does processing

darcs-hash:20080831003210-84dde-92ccffd5b2e1d50963b18babd93c70fb1d20cdba.gz
This commit is contained in:
Evan Prodromou
2008-08-30 20:32:10 -04:00
parent ea5b129163
commit d5f83d9252
5 changed files with 64 additions and 73 deletions

View File

@@ -81,21 +81,18 @@ class QueueHandler {
$this->log(LOG_WARNING, 'queue item for notice that does not exist');
}
$qi->delete();
$this->idle();
$this->idle(0);
} else {
$this->clear_old_claims();
$start = microtime();
$this->idle();
$used = microtime() - $start;
if ($used < 1000000) {
usleep(1000000 - $used);
}
$this->idle(5);
}
} while (true);
}
function idle() {
return true;
function idle($timeout=0) {
if ($timeout>0) {
sleep($timeout);
}
}
function clear_old_claims() {