Skip to content

Commit

Permalink
Add default schedule config for sitemap_generate job
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halsall committed Apr 24, 2018
1 parent 199272b commit 9463c77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/code/Magento/Sitemap/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions app/code/Magento/Sitemap/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,16 @@
</valid_paths>
</file>
</sitemap>
<crontab>
<default>
<jobs>
<sitemap_generate>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
</schedule>
</sitemap_generate>
</jobs>
</default>
</crontab>
</default>
</config>

0 comments on commit 9463c77

Please sign in to comment.