]> git.mxchange.org Git - friendica.git/blobdiff - include/cronhooks.php
template for input fields now supports required, autofocus and types email, url
[friendica.git] / include / cronhooks.php
index d5daf0d7d447a2beb4bb7a769872dd3b410b6dbf..3a09da48ceb3a16dba777731ea2e3e72efb058ea 100644 (file)
@@ -35,11 +35,17 @@ function cronhooks_run(&$argv, &$argc){
                }
        }
 
-       $lockpath = get_config('system','lockpath');
+       $lockpath = get_lockpath();
        if ($lockpath != '') {
-               $pidfile = new pidfile($lockpath, 'cron.lck');
+               $pidfile = new pidfile($lockpath, 'cronhooks');
                if($pidfile->is_already_running()) {
                        logger("cronhooks: Already running");
+                       if ($pidfile->running_time() > 19*60) {
+                                $pidfile->kill();
+                                logger("cronhooks: killed stale process");
+                               // Calling a new instance
+                               proc_run('php','include/cronhooks.php');
+                        }
                        exit;
                }
        }
@@ -52,8 +58,6 @@ function cronhooks_run(&$argv, &$argc){
 
        $d = datetime_convert();
 
-       set_time_limit(9*60*60); // Setting the maximum execution time for cronjobs to 9 minutes.
-
        call_hooks('cron', $d);
 
        logger('cronhooks: end');
@@ -62,6 +66,6 @@ function cronhooks_run(&$argv, &$argc){
 }
 
 if (array_search(__file__,get_included_files())===0){
-  cronhooks_run($argv,$argc);
+  cronhooks_run($_SERVER["argv"],$_SERVER["argc"]);
   killme();
 }