]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/queuedaemon.php
Make attachment fit better in notice: drop text and link
[quix0rs-gnu-social.git] / scripts / queuedaemon.php
index 582a3dd888f825ed0ff398a77629fffab9bf9628..6d7cfcf22260d3bcf38519cf2670c9f405d6082a 100755 (executable)
@@ -18,7 +18,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('INSTALLDIR', dirname(__DIR__));
+define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public');
 
 $shortoptions = 'fi:at:';
 $longoptions = array('id=', 'foreground', 'all', 'threads=');
@@ -168,12 +169,16 @@ 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();
 }
 
+common_log(LOG_INFO, sprintf('Launching QueueDaemon background process with %1$d threads.', $threads));
+
 $daemonize = !(have_option('f') || have_option('--foreground'));
 $all = have_option('a') || have_option('--all');