Queue: using lockpath, so that the queue only can run once a time.

This commit is contained in:
Michael Vogel 2014-03-16 17:37:20 +01:00
parent 49e16b0612
commit 32065dfad6
1 changed files with 16 additions and 6 deletions

View File

@ -79,10 +79,20 @@ function queue_run(&$argv, &$argc){
require_once("include/datetime.php");
require_once('include/items.php');
require_once('include/bbcode.php');
require_once('include/pidfile.php');
load_config('config');
load_config('system');
$lockpath = get_config('system','lockpath');
if ($lockpath != '') {
$pidfile = new pidfile($lockpath, 'queue.lck');
if($pidfile->is_already_running()) {
logger("queue: Already running");
return;
}
}
$a->set_baseurl(get_config('system','url'));
load_hooks();