summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/publicqueuehandler.php12
-rwxr-xr-xscripts/xmppconfirmhandler.php22
-rwxr-xr-xscripts/xmppqueuehandler.php11
3 files changed, 8 insertions, 37 deletions
diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php
index 9a7b6df5f..555298f6a 100755
--- a/scripts/publicqueuehandler.php
+++ b/scripts/publicqueuehandler.php
@@ -54,16 +54,8 @@ class PublicQueueHandler extends QueueHandler {
return jabber_public_notice($notice);
}
- function idle() {
- $this->log(LOG_DEBUG, 'Checking the incoming message queue.');
- # Process the queue for a second
- 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 idle($timeout=0) {
+ $this->conn->processTime($timeout);
}
function forward_message(&$pl) {
diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php
index 08a397fc4..7971198b1 100755
--- a/scripts/xmppconfirmhandler.php
+++ b/scripts/xmppconfirmhandler.php
@@ -86,16 +86,10 @@ class XmppConfirmHandler {
continue;
}
}
- $this->idle();
+ $this->idle(0);
} else {
# $this->clear_old_confirm_claims();
- $start = microtime();
- $this->idle();
- $used = microtime() - $start;
- if ($used < 10000000) {
- usleep(10000000 - $used);
- }
- sleep(10);
+ $this->idle(10);
}
} while (true);
}
@@ -137,16 +131,8 @@ class XmppConfirmHandler {
common_log($level, 'XmppConfirmHandler ('. $this->_id .'): '.$msg);
}
- function idle() {
- $this->log(LOG_DEBUG, 'Checking the incoming message queue.');
- # Process the queue for a second
- 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 idle($timeout=0) {
+ $this->conn->processTime($timeout);
}
function forward_message(&$pl) {
diff --git a/scripts/xmppqueuehandler.php b/scripts/xmppqueuehandler.php
index c6f5c3f12..7f1e6c28f 100755
--- a/scripts/xmppqueuehandler.php
+++ b/scripts/xmppqueuehandler.php
@@ -56,16 +56,9 @@ class XmppQueueHandler extends QueueHandler {
return jabber_broadcast_notice($notice);
}
- function idle() {
- $this->log(LOG_DEBUG, 'Checking the incoming message queue.');
+ function idle($timeout=0) {
# Process the queue for a second
- 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.');
- }
+ $this->conn->processTime($timeout);
}
function finish() {