1
0
mirror of synced 2025-03-06 12:56:10 +03:00

Allow gearman environment vars

This commit is contained in:
Waleed Gadelkareem 2017-01-13 18:09:36 +01:00 committed by GitHub
parent 31c40f8342
commit d137ffe0a4

View File

@ -16,7 +16,10 @@ class LockAgentWorker
$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']);