partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 8ebeab6b054cae7e8f83e5e2aadeea1ef8fa350f
parent c443dd1517658215d34bdd2a954b686812694ab7
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon, 28 Sep 2015 20:03:01 +0200

Mark partkeepr:cron:synctips in CronLogger, added default cronjobs

Diffstat:
Msrc/PartKeepr/CoreBundle/DependencyInjection/Configuration.php | 2+-
Msrc/PartKeepr/TipOfTheDayBundle/Resources/config/services.xml | 1+
Msrc/PartKeepr/TipOfTheDayBundle/Services/TipOfTheDayService.php | 11++++++++++-
3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/PartKeepr/CoreBundle/DependencyInjection/Configuration.php b/src/PartKeepr/CoreBundle/DependencyInjection/Configuration.php @@ -29,7 +29,7 @@ class Configuration implements ConfigurationInterface ->arrayNode('required_cronjobs') ->treatNullLike(array()) ->prototype('scalar')->end() - ->defaultValue(array('1', '2', '3')) + ->defaultValue(array('partkeepr:cron:synctips')) ->end() ->scalarNode('tip_of_the_day_list') ->cannotBeEmpty() diff --git a/src/PartKeepr/TipOfTheDayBundle/Resources/config/services.xml b/src/PartKeepr/TipOfTheDayBundle/Resources/config/services.xml @@ -8,6 +8,7 @@ <service id="partkeepr.tip_of_the_day_service" class="PartKeepr\TipOfTheDayBundle\Services\TipOfTheDayService"> <argument type="service" id="service_container"/> <argument type="service" id="doctrine.orm.entity_manager"/> + <argument type="service" id="partkeepr.cronlogger_service"/> </service> </services> </container> diff --git a/src/PartKeepr/TipOfTheDayBundle/Services/TipOfTheDayService.php b/src/PartKeepr/TipOfTheDayBundle/Services/TipOfTheDayService.php @@ -5,6 +5,7 @@ namespace PartKeepr\TipOfTheDayBundle\Services; use Doctrine\ORM\EntityManager; +use PartKeepr\CronLoggerBundle\Services\CronLoggerService; use PartKeepr\TipOfTheDayBundle\Entity\TipOfTheDay; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,10 +22,16 @@ class TipOfTheDayService */ private $entityManager; - public function __construct(ContainerInterface $container, EntityManager $entityManager) + /** + * @var CronLoggerService + */ + private $cronLoggerService; + + public function __construct(ContainerInterface $container, EntityManager $entityManager, CronLoggerService $cronLoggerService) { $this->container = $container; $this->entityManager = $entityManager; + $this->cronLoggerService = $cronLoggerService; } /** @@ -45,6 +52,8 @@ class TipOfTheDayService $aPageNames = $this->extractPageNames($tipsString); $this->updateTipDatabase($aPageNames); + + $this->cronLoggerService->markCronRun("partkeepr:cron:synctips"); } /**