diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-08-30 05:57:09 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-08-30 05:57:09 -0400 |
commit | 0217a74f130ee8075537a4f1316f554c25d51fe2 (patch) | |
tree | b94061ba4973cacaa68636e4d60c04b1e8d82d34 /scripts | |
parent | c46f152697b7abfe6a33bec38c6b793e288d85c8 (diff) |
check the state of the queue before diving in to process it
darcs-hash:20080830095709-84dde-a64262c1b32e506cb2c43f8b4fb55ab88effc22f.gz
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/xmppqueuehandler.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/xmppqueuehandler.php b/scripts/xmppqueuehandler.php index 040191c28..52db0eb59 100755 --- a/scripts/xmppqueuehandler.php +++ b/scripts/xmppqueuehandler.php @@ -53,9 +53,15 @@ class XmppQueueHandler extends QueueHandler { } function idle() { - $this->log(LOG_DEBUG, 'Processing the incoming message queue.'); + $this->log(LOG_DEBUG, 'Checking the incoming message queue.'); # Process the queue for a second - $this->conn->processTime(1); + if ($this->conn->readyToProcess()) { + $this->log(LOG_DEBUG, 'Something in the incoming message queue; processing it.'); + $this->conn->processTime(1); + $this->log(LOG_DEBUG, 'Done processing incoming message queue.'); + } else { + $this->log(LOG_DEBUG, 'Nothing in the incoming message queue; skipping it.'); + } } function finish() { |