]> 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 4825eb8a4d4cb0524e5e637804fe37d5f01ea566..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;
                }
        }