From d5f83d92521dbf838b1fc1fad2716efc3122c6b7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 30 Aug 2008 20:32:10 -0400 Subject: switch around how XMLStream does processing darcs-hash:20080831003210-84dde-92ccffd5b2e1d50963b18babd93c70fb1d20cdba.gz --- lib/queuehandler.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib/queuehandler.php') diff --git a/lib/queuehandler.php b/lib/queuehandler.php index ba7a93ab2..3115ea38d 100644 --- a/lib/queuehandler.php +++ b/lib/queuehandler.php @@ -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() { -- cgit v1.2.3-54-g00ecf