在 Magento 中禁用系统 crontab 作业
Disable system crontab job in Magento
是否可以通过 app/etc/local.xml
禁用系统 crontab 作业(例如 Mage_Catalog 中的“catalog_product_index_price_reindex_all”)?
这是解决方案,但您应该使用自定义模块重写 Mage/Catalog/etc/config.xml
快速解决方案:
去你的核心删除代码
Example: app/code/core/Mage/Catalog/etc/config.xml
删除
<crontab>
<jobs>
<catalog_product_index_price_reindex_all>
<schedule>
<cron_expr>0 2 * * *</cron_expr>
</schedule>
<run>
<model>catalog/observer::reindexProductPrices</model>
</run>
</catalog_product_index_price_reindex_all>
</jobs>
</crontab>
解决方案 2:
转到 */shell/indexer.php
在第 154 行附近找到此代码
if ($this->getArg('reindex')) {
$processes = $this->_parseIndexerString($this->getArg('reindex'));
} else {
$processes = $this->_parseIndexerString('all');
}
评论$processes = $this->_parseIndexerString('all');
成为
if ($this->getArg('reindex')) {
$processes = $this->_parseIndexerString($this->getArg('reindex'));
} else {
// $processes = $this->_parseIndexerString('all');
}
我会说避免破解 shell 索引器或核心。
创建自定义模块并将时间表重写为 运行,例如 2 月 31 日(永远不会发生)。
或者如果你想全局禁用它,并避免 运行ning 它,即使你真的需要重新索引所有,那么只需覆盖 catalog/observer
观察者模型并添加你的 reindexProductPrices()
方法,你只是 return 出了方法。
是否可以通过 app/etc/local.xml
禁用系统 crontab 作业(例如 Mage_Catalog 中的“catalog_product_index_price_reindex_all”)?
这是解决方案,但您应该使用自定义模块重写 Mage/Catalog/etc/config.xml
快速解决方案:
去你的核心删除代码
Example: app/code/core/Mage/Catalog/etc/config.xml
删除
<crontab>
<jobs>
<catalog_product_index_price_reindex_all>
<schedule>
<cron_expr>0 2 * * *</cron_expr>
</schedule>
<run>
<model>catalog/observer::reindexProductPrices</model>
</run>
</catalog_product_index_price_reindex_all>
</jobs>
</crontab>
解决方案 2:
转到 */shell/indexer.php
在第 154 行附近找到此代码
if ($this->getArg('reindex')) {
$processes = $this->_parseIndexerString($this->getArg('reindex'));
} else {
$processes = $this->_parseIndexerString('all');
}
评论$processes = $this->_parseIndexerString('all');
成为
if ($this->getArg('reindex')) {
$processes = $this->_parseIndexerString($this->getArg('reindex'));
} else {
// $processes = $this->_parseIndexerString('all');
}
我会说避免破解 shell 索引器或核心。
创建自定义模块并将时间表重写为 运行,例如 2 月 31 日(永远不会发生)。
或者如果你想全局禁用它,并避免 运行ning 它,即使你真的需要重新索引所有,那么只需覆盖 catalog/observer
观察者模型并添加你的 reindexProductPrices()
方法,你只是 return 出了方法。