From 0b859217153c9b1ef97a0392166d76272d5a2ac8 Mon Sep 17 00:00:00 2001 From: James Halsall Date: Mon, 23 Apr 2018 15:15:45 +0100 Subject: [PATCH 1/3] Add default schedule config for sitemap_generate job --- app/code/Magento/Sitemap/Model/Observer.php | 10 +++++----- app/code/Magento/Sitemap/etc/config.xml | 11 +++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sitemap/Model/Observer.php b/app/code/Magento/Sitemap/Model/Observer.php index 840a6a1858fae..755b858398c95 100644 --- a/app/code/Magento/Sitemap/Model/Observer.php +++ b/app/code/Magento/Sitemap/Model/Observer.php @@ -17,11 +17,6 @@ class Observer */ const XML_PATH_GENERATION_ENABLED = 'sitemap/generate/enabled'; - /** - * Cronjob expression configuration - */ - const XML_PATH_CRON_EXPR = 'crontab/default/jobs/generate_sitemaps/schedule/cron_expr'; - /** * Error email template configuration */ @@ -64,6 +59,11 @@ class Observer */ protected $inlineTranslation; + /** + * @var \Magento\Cron\Model\ScheduleFactory + */ + private $scheduleFactory; + /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory $collectionFactory diff --git a/app/code/Magento/Sitemap/etc/config.xml b/app/code/Magento/Sitemap/etc/config.xml index 73468baadcb90..6f14ff728ac4f 100644 --- a/app/code/Magento/Sitemap/etc/config.xml +++ b/app/code/Magento/Sitemap/etc/config.xml @@ -42,5 +42,16 @@ + + + + + + 0 0 * * * + + + + + From 01f6fc21a691923663faafdc5e8e1df1073d3f23 Mon Sep 17 00:00:00 2001 From: James Halsall Date: Tue, 24 Apr 2018 12:06:38 +0100 Subject: [PATCH 2/3] Cleanup --- app/code/Magento/Sitemap/Model/Observer.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Sitemap/Model/Observer.php b/app/code/Magento/Sitemap/Model/Observer.php index 755b858398c95..c3eb34602e94c 100644 --- a/app/code/Magento/Sitemap/Model/Observer.php +++ b/app/code/Magento/Sitemap/Model/Observer.php @@ -59,11 +59,6 @@ class Observer */ protected $inlineTranslation; - /** - * @var \Magento\Cron\Model\ScheduleFactory - */ - private $scheduleFactory; - /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory $collectionFactory From a324f86feb372a52b6b8bacf470639c8fd6d77a9 Mon Sep 17 00:00:00 2001 From: James Halsall Date: Tue, 24 Apr 2018 16:04:46 +0100 Subject: [PATCH 3/3] Fixup --- app/code/Magento/Sitemap/Model/Observer.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/code/Magento/Sitemap/Model/Observer.php b/app/code/Magento/Sitemap/Model/Observer.php index c3eb34602e94c..a536ec998b827 100644 --- a/app/code/Magento/Sitemap/Model/Observer.php +++ b/app/code/Magento/Sitemap/Model/Observer.php @@ -17,6 +17,13 @@ class Observer */ const XML_PATH_GENERATION_ENABLED = 'sitemap/generate/enabled'; + /** + * Cronjob expression configuration + * + * @deprecated Use \Magento\Cron\Model\Config\Backend\Sitemap::CRON_STRING_PATH instead. + */ + const XML_PATH_CRON_EXPR = 'crontab/default/jobs/generate_sitemaps/schedule/cron_expr'; + /** * Error email template configuration */