0

我的 Google 站点地图最初设置为每天自动生成,但它在服务器上造成了相当大的负载,因此我更改了 Magento 管理员中的设置(系统 > 配置 > 谷歌站点地图 > 生成设置(每周),使其每周运行。站点地图仍然每天生成。有什么我遗漏或需要更改的吗?

4

2 回答 2

1

我正在寻找同样的问题。

里面好像有bugMage_Adminhtml_Model_System_Config_Backend_Sitemap_Cron::_afterSave

第 45 行读取$frequncy = $this->getData('groups/generate/frequency/value');

并且应该阅读$frequncy = $this->getData('groups/generate/fields/frequency/value');

我刚刚尝试了这个,它在每个频率选项上都能正常工作

解释:

当您保存站点地图配置时,会调用此方法来重新计算用于生成站点地图的 cron 表达式,然后由 cron 模块读取该表达式以安排并稍后运行任务。在第 57 和 59 行,它试图确定频率是每周还是每月,否则为每日。由于最初读取的值是错误的,因此它始终默认为每天。

此外,变量可能应该被命名$frequency而不是$frequncy

于 2015-02-04T20:00:58.147 回答
0

1. Configuration scope

Check you configured the sitemap generation frequency in the right scope (default, website or storefront) and the other configuration scopes do not have other values.

2. Cron scheduling settings

Maybe unlikely, but possibly there might still be some cron tasks scheduled. The settings for this can be found under Admin > System > Configuration > System > Cron. Though you'd have to set those values pretty high. I believe the defaults (or at least sane) values are 15 / 20 / 15 / 10 / 60 / 600.

3. Cache? / Bugs

Another issue, as always with Magento, might be cache, clear the cache (sounds unlikely to me too).

I do not know of any problems relating to this system, nor other things you might be able to do to fix this.

4. Debugging

The frequency option depends on a backend model to implement an _afterSave() method to handle the option. What it does is figure out the selected frequency / times and it makes a string that can be used for the cron configuration. It then saves this in core_config_data.

To debug the aftersave function (to check why it is maybe not saving correcty) you will need to have the following class: Mage_Adminhtml_Model_System_Config_Backend_Sitemap_Cron

To check if the value is properly saved in the database you need to search for the following path: crontab/jobs/sitemap_generate/schedule/cron_expr

If you edit the database directly it will be overridden next time you save the sitemap generation settings.

Other

Next to that I can recommend this plugin to inspect the cron schedule table in the database. All it does is read the data in there (and offer some other neat little features) but it can be fairly usefull if you're not very familiar with the Magento code / database architecture. http://www.magentocommerce.com/magento-connect/aoe-scheduler.html

于 2013-10-22T09:16:50.673 回答