mirror of
https://github.com/friendica/friendica
synced 2024-11-10 03:02:54 +00:00
Add separate lock file for cronhooks, which might also take a long time and shouldn't be allowed to interfere with itself
This commit is contained in:
parent
d685181101
commit
10b68ef837
1 changed files with 11 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue