1
0
mirror of synced 2025-02-03 05:49:25 +03:00

Merge pull request #6231 from gadelkareem/patch-2

Allow gearman environment vars
This commit is contained in:
Marco Pivetta 2017-01-14 01:15:46 +01:00 committed by GitHub
commit 3d7ddc89b4

View File

@ -16,7 +16,10 @@ class LockAgentWorker
$lockAgent = new LockAgentWorker(); $lockAgent = new LockAgentWorker();
$worker = new \GearmanWorker(); $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("findWithLock", [$lockAgent, "findWithLock"]);
$worker->addFunction("dqlWithLock", [$lockAgent, "dqlWithLock"]); $worker->addFunction("dqlWithLock", [$lockAgent, "dqlWithLock"]);
$worker->addFunction('lock', [$lockAgent, 'lock']); $worker->addFunction('lock', [$lockAgent, 'lock']);