From 10b68ef8378a552a0e0483f01dc527f84f9c2127 Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Tue, 12 Mar 2013 14:41:41 +0100 Subject: [PATCH 1/2] Add separate lock file for cronhooks, which might also take a long time and shouldn't be allowed to interfere with itself --- include/cronhooks.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/cronhooks.php b/include/cronhooks.php index 6aa0721363..48f1571916 100644 --- a/include/cronhooks.php +++ b/include/cronhooks.php @@ -19,15 +19,26 @@ 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(); logger('cronhooks: start'); +echo("@@@ cronhooks start\n"); $d = datetime_convert(); From c3621407d1dd4043e9f7c44b56da6a278b062e50 Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Thu, 28 Mar 2013 10:29:27 +0800 Subject: [PATCH 2/2] Remove debug line added by mistake --- include/cronhooks.php | 1 - 1 file changed, 1 deletion(-) diff --git a/include/cronhooks.php b/include/cronhooks.php index 48f1571916..15d49fe547 100644 --- a/include/cronhooks.php +++ b/include/cronhooks.php @@ -38,7 +38,6 @@ function cronhooks_run(&$argv, &$argc){ load_hooks(); logger('cronhooks: start'); -echo("@@@ cronhooks start\n"); $d = datetime_convert();