]> git.mxchange.org Git - friendica.git/blobdiff - include/cronhooks.php
Send notifications for each new post of a contact, option for creating a summary...
[friendica.git] / include / cronhooks.php
index 6aa0721363a9eb374142227d6541f1a5f2438359..15d49fe5474b32101c60ff5ba90b58c383f1ac39 100644 (file)
@@ -19,10 +19,20 @@ function cronhooks_run(&$argv, &$argc){
 
        require_once('include/session.php');
        require_once('include/datetime.php');
+       require_once('include/pidfile.php');
 
        load_config('config');
        load_config('system');
 
+       $lockpath = get_config('system','lockpath');
+       if ($lockpath != '') {
+               $pidfile = new pidfile($lockpath, 'cron.lck');
+               if($pidfile->is_already_running()) {
+                       logger("cronhooks: Already running");
+                       exit;
+               }
+       }
+
        $a->set_baseurl(get_config('system','url'));
 
        load_hooks();