Skip to content

Commit 0b85921

Browse files
James Halsallrostyslav-hymon
authored andcommitted
Add default schedule config for sitemap_generate job
1 parent 910ca33 commit 0b85921

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

app/code/Magento/Sitemap/Model/Observer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ class Observer
1717
*/
1818
const XML_PATH_GENERATION_ENABLED = 'sitemap/generate/enabled';
1919

20-
/**
21-
* Cronjob expression configuration
22-
*/
23-
const XML_PATH_CRON_EXPR = 'crontab/default/jobs/generate_sitemaps/schedule/cron_expr';
24-
2520
/**
2621
* Error email template configuration
2722
*/
@@ -64,6 +59,11 @@ class Observer
6459
*/
6560
protected $inlineTranslation;
6661

62+
/**
63+
* @var \Magento\Cron\Model\ScheduleFactory
64+
*/
65+
private $scheduleFactory;
66+
6767
/**
6868
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
6969
* @param \Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory $collectionFactory

app/code/Magento/Sitemap/etc/config.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,16 @@
4242
</valid_paths>
4343
</file>
4444
</sitemap>
45+
<crontab>
46+
<default>
47+
<jobs>
48+
<sitemap_generate>
49+
<schedule>
50+
<cron_expr>0 0 * * *</cron_expr>
51+
</schedule>
52+
</sitemap_generate>
53+
</jobs>
54+
</default>
55+
</crontab>
4556
</default>
4657
</config>

0 commit comments

Comments
 (0)