]> git.mxchange.org Git - friendica.git/commitdiff
cron: move update_suggestions in separated thread
authorfabrixxm <fabrix.xm@gmail.com>
Sat, 7 Nov 2015 16:52:52 +0000 (17:52 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Sat, 7 Nov 2015 16:52:52 +0000 (17:52 +0100)
Move the call in  discover_poco.php.
This should fix expiration and other cron related issues

include/cron.php
include/discover_poco.php

index 46067d76da05f88c10b4173c212466abee82c7e0..7b2244b55eda9a4c370ec5104479a11b57d796e6 100644 (file)
@@ -151,9 +151,10 @@ function cron_run(&$argv, &$argc){
 
                update_contact_birthdays();
 
-               update_suggestions();
+               proc_run('php',"include/discover_poco.php", "suggestions");
 
                set_config('system','last_expire_day',$d2);
+
                proc_run('php','include/expire.php');
        }
 
index 79958a8849a4235b7a53156cc5c2fdddd26de046..a8e7ec64d04743a44e8ddd68bfe6858756ad2a6d 100644 (file)
@@ -41,6 +41,8 @@ function discover_poco_run(&$argv, &$argc){
                $mode = 1;
        } elseif(($argc == 2) && ($argv[1] == "checkcontact")) {
                $mode = 2;
+       } elseif(($argc == 2) && ($argv[1] == "suggestions")) {
+               $mode = 3;
        } elseif ($argc == 1) {
                $search = "";
                $mode = 0;
@@ -69,7 +71,9 @@ function discover_poco_run(&$argv, &$argc){
 
        logger('start '.$search);
 
-       if (($mode == 2) AND get_config('system','poco_completion'))
+       if ($mode==3)
+               update_suggestions();
+       elseif (($mode == 2) AND get_config('system','poco_completion'))
                discover_users();
        elseif (($mode == 1) AND ($search != "") and get_config('system','poco_local_search'))
                discover_directory($search);