开发者

Update Magento cron job setting in config.xml of a given module

开发者 https://www.devze.com 2022-12-27 15:28 出处:网络
I want to set the cron job in the config file of the Catalog module to be ran at a different time. Currently it is setup like this in the config.xml

I want to set the cron job in the config file of the Catalog module to be ran at a different time. Currently it is setup like this in the config.xml

 <crontab>
        <jobs>
            <catalog_product_index_price_reindex_all>
                <schedule><cron_expr>0 2 * * *</cron_expr></schedule>
                <run><model>catalog/product_indexer_price::reindexAll</model></run>
            </catalog_product_index_price_reindex_all>
        </jobs>
    </crontab>

I have already made overloads to classes in the Catalog Module in my own Catalog Module in the local directory. I put the following in my config.xml file but it never gets added to the cron schedule table

<crontab>
开发者_如何学编程        <jobs>
            <catalog_product_index_price_reindex_all>
                <schedule><cron_expr>*/2 * * * *</cron_expr></schedule>
                <run><model>catalog/product_indexer_price::reindexAll</model></run>
            </catalog_product_index_price_reindex_all>
        </jobs>
    </crontab>

Obviously I am trying to do it every 2 minutes for testing. Or is the only way to update the config files is to copy it and put it in a local/Mage/... directory?


Nevermind it was a cache issue, cleared cache and it worked. So you can just use your own Catalog Module to update the cron jobs, however I am not sure if this overwrites the other one or just adds it and the core one will also be ran, which for what I am doing, I don't care.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号