aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-08 05:19:54 -0700
committerfriendica <info@friendica.com>2012-04-08 05:19:54 -0700
commitc3867f4ce4249079e1dba04ebfdc74457afbee7b (patch)
tree72be41253ec910e6488e34bb5181c359036da9dd /include/poller.php
parente3b2ac0735c908357dafb8670339fd34d3e2e6c0 (diff)
parentce0eac44b5035b8f46259b6665826a94b633ec4e (diff)
downloadvolse-hubzilla-c3867f4ce4249079e1dba04ebfdc74457afbee7b.tar.gz
volse-hubzilla-c3867f4ce4249079e1dba04ebfdc74457afbee7b.tar.bz2
volse-hubzilla-c3867f4ce4249079e1dba04ebfdc74457afbee7b.zip
Merge pull request #214 from annando/master
API, Locking, some changes to "vier"
Diffstat (limited to 'include/poller.php')
-rw-r--r--include/poller.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/poller.php b/include/poller.php
index 90a97867c..499483d00 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -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();