]> 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 9b18fe3c6d9901dbe5f79c4f0cecb6e54f475270..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;
                }
        }
@@ -174,7 +180,7 @@ function poller_run(&$argv, &$argc){
                : '' 
        );
 
-       $contacts = q("SELECT `contact`.`id` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` 
+       $contacts = q("SELECT `contact`.`id` FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid` 
                WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != ''
                AND NOT `network` IN ( '%s', '%s', '%s' )
                $sql_extra