1
0
Fork 0

poller: An optional lockfile is used to check if the poller is already running

This commit is contained in:
Michael Vogel 2012-04-01 20:52:33 +02:00
commit 4cf1e5aa21
2 changed files with 14 additions and 1 deletions

View file

@ -25,10 +25,20 @@ function poller_run($argv, $argc){
require_once('include/Contact.php');
require_once('include/email.php');
require_once('include/socgraph.php');
require_once('include/pidfile.php');
load_config('config');
load_config('system');
$lockpath = get_config('system','lockpath');
if ($lockpath != '') {
$pidfile = new pidfile($lockpath, 'poller.lck');
if($pidfile->is_already_running()) {
logger("poller: Already running");
exit;
}
}
$a->set_baseurl(get_config('system','url'));
load_hooks();