]> git.mxchange.org Git - friendica.git/blobdiff - include/poller.php
Let an item be accssible via the GUI (additionally to uid and item id)
[friendica.git] / include / poller.php
index 084067b190059c3c6f0290b2476811b1f2c87d82..46f1079fd11c74042fd372f83ab1f7b14d17f633 100644 (file)
@@ -41,11 +41,17 @@ function poller_run(&$argv, &$argc){
                }
        }
 
-       $lockpath = get_config('system','lockpath');
+       $lockpath = get_lockpath();
        if ($lockpath != '') {
-               $pidfile = new pidfile($lockpath, 'poller.lck');
+               $pidfile = new pidfile($lockpath, 'poller');
                if($pidfile->is_already_running()) {
                        logger("poller: Already running");
+                       if ($pidfile->running_time() > 9*60) {
+                                $pidfile->kill();
+                                logger("poller: killed stale process");
+                                // Calling a new instance
+                                proc_run('php','include/poller.php');
+                        }
                        exit;
                }
        }