]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/queuedaemon.php
File_redirection->getFile could never get the file anyway if $redir->file_id was...
[quix0rs-gnu-social.git] / scripts / queuedaemon.php
index 6dba16f95388a03d9533bcc46a04af6514cfb139..8fb0f8e0aeab83aa0c48e9fd6636b4a278e84171 100755 (executable)
@@ -105,7 +105,7 @@ class QueueDaemon extends SpawningDaemon
     {
         $this->log(LOG_INFO, 'checking for queued notices');
 
-        $master = new QueueMaster($this->get_id());
+        $master = new QueueMaster($this->get_id(), $this->processManager());
         $master->init($this->allsites);
         try {
             $master->service();
@@ -125,6 +125,14 @@ class QueueDaemon extends SpawningDaemon
 
 class QueueMaster extends IoMaster
 {
+    protected $processManager;
+
+    function __construct($id, $processManager)
+    {
+        parent::__construct($id);
+        $this->processManager = $processManager;
+    }
+
     /**
      * Initialize IoManagers which are appropriate to this instance.
      */
@@ -135,6 +143,7 @@ class QueueMaster extends IoMaster
             $qm = QueueManager::get();
             $qm->setActiveGroup('main');
             $managers[] = $qm;
+            $managers[] = $this->processManager;
         }
         Event::handle('EndQueueDaemonIoManagers', array(&$managers));
 
@@ -159,7 +168,9 @@ if (have_option('t')) {
 } else if (have_option('--threads')) {
     $threads = intval(get_option_value('--threads'));
 } else {
-    $threads = 0;
+    //If there is no argument for number of threads
+    //Try reading a config option for the number
+    $threads = common_config('queue','threads');
 }
 if (!$threads) {
     $threads = getProcessorCount();