Skip to content

Commit

Permalink
Allow gearman environment vars
Browse files Browse the repository at this point in the history
  • Loading branch information
gadelkareem authored Jan 13, 2017
1 parent 31c40f8 commit d137ffe
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ static public function run()
$lockAgent = new LockAgentWorker();

$worker = new \GearmanWorker();
$worker->addServer();
$worker->addServer(
isset($_SERVER['GEARMAN_HOST']) ? $_SERVER['GEARMAN_HOST'] : null,
isset($_SERVER['GEARMAN_PORT']) ? $_SERVER['GEARMAN_PORT'] : 4730
);
$worker->addFunction("findWithLock", [$lockAgent, "findWithLock"]);
$worker->addFunction("dqlWithLock", [$lockAgent, "dqlWithLock"]);
$worker->addFunction('lock', [$lockAgent, 'lock']);
Expand Down

0 comments on commit d137ffe

Please sign in to comment.