diff options
author | Evan Prodromou <evan@status.net> | 2010-06-01 13:51:41 -0700 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-06-01 13:51:41 -0700 |
commit | a5de2152672f49ad95f114033ef6bf00ece9a0ab (patch) | |
tree | c31d031fb8ffb20b8497a80a7cf13958c50f5ad5 /lib/stompqueuemanager.php | |
parent | 6d8e01ad13dd9bc9e149f43a1eb88671d4737f4d (diff) | |
parent | 634752f0d262b4fb02456889250378fca084cd2e (diff) |
Merge branch 'master' of gitorious.org:statusnet/mainline
Diffstat (limited to 'lib/stompqueuemanager.php')
-rw-r--r-- | lib/stompqueuemanager.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php index 5d5c7ccfb..de4ba7f01 100644 --- a/lib/stompqueuemanager.php +++ b/lib/stompqueuemanager.php @@ -122,7 +122,19 @@ class StompQueueManager extends QueueManager public function enqueue($object, $queue) { $this->_connect(); - return $this->_doEnqueue($object, $queue, $this->defaultIdx); + if (common_config('queue', 'stomp_enqueue_on')) { + // We're trying to force all writes to a single server. + // WARNING: this might do odd things if that server connection dies. + $idx = array_search(common_config('queue', 'stomp_enqueue_on'), + $this->servers); + if ($idx === false) { + common_log(LOG_ERR, 'queue stomp_enqueue_on setting does not match our server list.'); + $idx = $this->defaultIdx; + } + } else { + $idx = $this->defaultIdx; + } + return $this->_doEnqueue($object, $queue, $idx); } /** |