]> git.mxchange.org Git - friendica.git/blobdiff - include/queue.php
BBCode: Add a linefeed between a picture and the following text. This is important...
[friendica.git] / include / queue.php
index 7fb6c6d90a7f553ad593bd85e04f125b934b69e1..3c28cefaf279bb76c8244f81ff7a6ed8cc4da1e0 100644 (file)
@@ -84,11 +84,17 @@ function queue_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
-       $lockpath = get_config('system','lockpath');
+       $lockpath = get_lockpath();
        if ($lockpath != '') {
-               $pidfile = new pidfile($lockpath, 'queue.lck');
+               $pidfile = new pidfile($lockpath, 'queue');
                if($pidfile->is_already_running()) {
                        logger("queue: Already running");
+                       if ($pidfile->running_time() > 9*60) {
+                               $pidfile->kill();
+                               logger("queue: killed stale process");
+                               // Calling a new instance
+                               proc_run('php',"include/queue.php");
+                       }
                        return;
                }
        }
@@ -106,8 +112,6 @@ function queue_run(&$argv, &$argc){
 
        logger('queue: start');
 
-       set_time_limit(9*60*60); // Setting the maximum execution time for queue job to 9 minutes.
-
        handle_pubsubhubbub();
 
        $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));