Merge pull request #657 from mexon/cron_lock
Add separate lock file for cronhooks, which might also take a long time ...
This commit is contained in:
commit
1eb56116e8
|
@ -19,10 +19,20 @@ function cronhooks_run(&$argv, &$argc){
|
||||||
|
|
||||||
require_once('include/session.php');
|
require_once('include/session.php');
|
||||||
require_once('include/datetime.php');
|
require_once('include/datetime.php');
|
||||||
|
require_once('include/pidfile.php');
|
||||||
|
|
||||||
load_config('config');
|
load_config('config');
|
||||||
load_config('system');
|
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'));
|
$a->set_baseurl(get_config('system','url'));
|
||||||
|
|
||||||
load_hooks();
|
load_hooks();
|
||||||
|
|
Loading…
Reference in a new issue