Queue: using lockpath, so that the queue only can run once a time.
This commit is contained in:
parent
49e16b0612
commit
32065dfad6
1 changed files with 16 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue