更新给定模块的config.xml中的Magento cron作业设置

更新给定模块的config.xml中的Magento cron作业设置

问题描述:

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?

我想在目录模块的配置文件中设置cron作业,以便在不同的时间运行。 目前,它在config.xml中设置如下 p>

 &lt; crontab&gt; 
&lt; jobs&gt; 
&lt; catalog_product_index_price_reindex_all&gt; 
&lt; schedule&gt;&lt; cron_expr&gt  ; 0 2 * * *&lt; / cron_expr&gt;&lt; / schedule&gt; 
&lt; run&gt;&lt; model&gt; catalog / product_indexer_price :: reindexAll&lt; / model&gt;&lt; / run&gt; 
&lt; / catalog_product_index_price_reindex_all&gt; 
  &lt; / jobs&gt; 
&lt; / crontab&gt; 
  code>  pre> 
 
 

我已经在本地目录中我自己的目录模块中的目录模块中对类进行了重载。 我将以下内容放在我的config.xml文件中,但它永远不会被添加到cron调度表中 p>

 &lt; crontab&gt; 
&lt; jobs&gt; 
&lt; catalog_product_index_price_reindex_all&gt;  
&lt; schedule&gt;&lt; cron_expr&gt; * / 2 * * * *&lt; / cron_expr&gt;&lt; / schedule&gt; 
&lt; run&gt;&lt; model&gt; catalog / product_indexer_price :: reindexAll&lt; / model&gt;&lt; / 运行&gt; 
&lt; / catalog_product_index_price_reindex_all&gt; 
&lt; / jobs&gt; 
&lt; / crontab&gt; 
  code>  pre> 
 
 

显然我每2分钟尝试一次 用于检测。 或者更新配置文件的唯一方法是复制它并将其放在local / Mage / ...目录中? p> div>

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.