]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Queue daemon fixes:
authorBrion Vibber <brion@pobox.com>
Wed, 10 Feb 2010 18:59:30 +0000 (10:59 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 10 Feb 2010 18:59:30 +0000 (10:59 -0800)
* skip unnecessary unsubscribes on graceful shutdown -- takes a long time for many queues, slows down our restarts when hitting graceful mem limit
* fix control channel (was broken when we switched to support multiple queue servers)

lib/stompqueuemanager.php

index 6730cd213d789dcd1e4de8ed273a27f8653a4ebf..cc4c817d8f7736be37dc1d4e6f00335413c57a30 100644 (file)
@@ -107,9 +107,10 @@ class StompQueueManager extends QueueManager
             $message .= ':' . $param;
         }
         $this->_connect();
-        $result = $this->_send($this->control,
-                               $message,
-                               array ('created' => common_sql_now()));
+        $con = $this->cons[$this->defaultIdx];
+        $result = $con->send($this->control,
+                             $message,
+                             array ('created' => common_sql_now()));
         if ($result) {
             $this->_log(LOG_INFO, "Sent control ping to queue daemons: $message");
             return true;
@@ -368,17 +369,10 @@ class StompQueueManager extends QueueManager
         foreach ($this->cons as $i => $con) {
             if ($con) {
                 $this->rollback($i);
-                $con->unsubscribe($this->control);
+                $con->disconnect();
+                $this->cons[$i] = null;
             }
         }
-        if ($this->sites) {
-            foreach ($this->sites as $server) {
-                StatusNet::init($server);
-                $this->doUnsubscribe();
-            }
-        } else {
-            $this->doUnsubscribe();
-        }
         return true;
     }