Skip to content

Instantly share code, notes, and snippets.

@akd3vs
Created July 17, 2015 17:53
Show Gist options
  • Save akd3vs/191232feaf93d2de8613 to your computer and use it in GitHub Desktop.
Save akd3vs/191232feaf93d2de8613 to your computer and use it in GitHub Desktop.
public function execute(InputInterface $input, OutputInterface $output)
{
$container = $this->getContainer();
/** @var Configurator $configurator */
$configurator = $container->get('nettic_wholesalers.config');
$configurator->isBackgroundProcess = true;
$bjRepository = $configurator->getRepository('backgroundJob');
$pendingJobs = $bjRepository->findBy([
'finishedAt' => null
]);
if($pendingJobs) {
$date = new \DateTime();
$greenLight = $configurator->setConfiguration($this->group, $date->format('d/m/Y h:i:s'));
if($greenLight) {
$wholesalerSync = $container->get('nettic_wholesalers.sync');
$wholesalerSync->all();
$configurator->removeConfiguration($this->group);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment