Permalink
Browse files

Merge pull request #12 from thorsten/development

Added possibility to automatically set container on workers implementing...
  • Loading branch information...
2 parents 3519bcf + 929fa68 commit eb9ce3115727212a21022a513b1636d734b9dc52 Marc committed May 25, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Mmoreramerino/GearmanBundle/Service/GearmanExecute.php
@@ -47,13 +47,13 @@ private function callJob(Array $worker)
$this->addServers($gmworker, $worker['servers']);
}
-
-
-
if (null !== $worker['service']) {
$objInstance = $this->container->get($worker['service']);
} else {
$objInstance = new $worker['className'];
+ if ($objInstance instanceof \Symfony\Component\DependencyInjection\ContainerAwareInterface) {
+ $objInstance->setContainer($this->container);
+ }
}
foreach ($jobs as $job) {

0 comments on commit eb9ce31

Please sign in to comment.