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

View file

@ -79,10 +79,20 @@ function queue_run(&$argv, &$argc){
require_once("include/datetime.php"); require_once("include/datetime.php");
require_once('include/items.php'); require_once('include/items.php');
require_once('include/bbcode.php'); require_once('include/bbcode.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, 'queue.lck');
if($pidfile->is_already_running()) {
logger("queue: Already running");
return;
}
}
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));
load_hooks(); load_hooks();