]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge pull request #2682 from annando/1607-api-generic-xml
[friendica.git] / boot.php
index 70ab308169c64618de879493b3b097b29994cbe1..bbfd671955215a1e5ebb4847a98654efdbaea41b 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -38,7 +38,7 @@ define ( 'FRIENDICA_PLATFORM',     'Friendica');
 define ( 'FRIENDICA_CODENAME',     'Asparagus');
 define ( 'FRIENDICA_VERSION',      '3.5-dev' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
-define ( 'DB_UPDATE_VERSION',      1198      );
+define ( 'DB_UPDATE_VERSION',      1200      );
 
 /**
  * @brief Constant with a HTML line break.
@@ -1786,12 +1786,31 @@ function proc_run($cmd){
                        $found = q("SELECT `id` FROM `workerqueue` WHERE `parameter` = '%s'",
                                        dbesc($parameters));
 
+                       $funcname = str_replace(".php", "", basename($argv[0]))."_run";
+
+                       // Define the processes that have priority over any other process
+                       /// @todo Better check for priority processes
+                       $high_priority = array("delivery_run", "notifier_run", "pubsubpublish_run");
+                       $low_priority = array("queue_run", "gprobe_run", "discover_poco_run");
+
+                       if (in_array($funcname, $high_priority))
+                               $priority = 1;
+                       elseif (in_array($funcname, $low_priority))
+                               $priority = 3;
+                       else
+                               $priority = 2;
+
                        if (!$found)
+                               //  quickfix for the delivery problems, 2106-07-28
+                               /// @todo find better solution
+                               //q("INSERT INTO `workerqueue` (`function`, `parameter`, `created`, `priority`)
+                               //                      VALUES ('%s', '%s', '%s', %d)",
+                               //      dbesc($funcname),
                                q("INSERT INTO `workerqueue` (`parameter`, `created`, `priority`)
                                                        VALUES ('%s', '%s', %d)",
                                        dbesc($parameters),
                                        dbesc(datetime_convert()),
-                                       intval(0));
+                                       intval($priority));
 
                        // Should we quit and wait for the poller to be called as a cronjob?
                        if (get_config("system", "worker_dont_fork"))