在Magento禁用系统crontab工作



是否可以通过 app/etc/local.xml

我要说的是要避免破解壳索引或核心。

创建一个自定义模块,然后重写时间表以在2月31日(永远不会发生)。

或如果您想在全球范围内禁用它,即使您真的需要全部需要重新索引,则避免运行它,然后覆盖catalog/observer观察者模型并添加您的reindexProductPrices()方法,其中您只需返回方法。

这是解决方案,但是您应该使用自定义模块重写法师/目录/etc/config.xml

快速解决方案

转到您的核心并删除代码

示例: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');
        }

最新更新