]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of gitorious.org:statusnet/mainline
authorBrion Vibber <brion@pobox.com>
Fri, 21 May 2010 21:09:05 +0000 (14:09 -0700)
committerBrion Vibber <brion@pobox.com>
Fri, 21 May 2010 21:09:05 +0000 (14:09 -0700)
lib/stompqueuemanager.php

index 5d5c7ccfbd9cfd81b6450bd2cfd082ab8e10c803..de4ba7f01fdce59b8ebfa3b94bbb68f4390db7f9 100644 (file)
@@ -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);
     }
 
     /**