Skip to main content
Tweeted twitter.com/StackMagento/status/777568305083285504
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

I'm trying to set-up a cron job for multiple models. I have two methods (method1 and method2) in Model (observer.php) for which I want to set cron job. My code :

Config.xml file :

 <crontab>
        <jobs>            
        <erpbridge_update>
            <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
            <run>
                <model>erpbridge/observer::method1</model>
            </run>
            
        </erpbridge_update>  
        <mss_erpbridge>
                <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
                <run>
            <model>erpbridge/observer::method2</model>
            </run>
            </mss_erpbridge>
        
        </jobs>
    </crontab>

Name space is Mss and module name is Erpbridge, CornCron job with the right module name working perfectly <mss_erpbridge> but this is not working </erpbridge_update>. When I set the same key for both <mss_erpbridge> then only the second works.

My query :

Is it possible to set a cron job for multiple Models if yes, How?

I'm trying to set-up a cron job for multiple models. I have two methods (method1 and method2) in Model (observer.php) for which I want to set cron job. My code :

Config.xml file :

 <crontab>
        <jobs>            
        <erpbridge_update>
            <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
            <run>
                <model>erpbridge/observer::method1</model>
            </run>
            
        </erpbridge_update>  
        <mss_erpbridge>
                <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
                <run>
            <model>erpbridge/observer::method2</model>
            </run>
            </mss_erpbridge>
        
        </jobs>
    </crontab>

Name space is Mss and module name is Erpbridge, Corn with the right module name working perfectly <mss_erpbridge> but this is not working </erpbridge_update>. When I set the same key for both <mss_erpbridge> then only the second works.

My query :

Is it possible to set a cron job for multiple Models if yes, How?

I'm trying to set-up a cron job for multiple models. I have two methods (method1 and method2) in Model (observer.php) for which I want to set cron job. My code :

Config.xml file :

 <crontab>
        <jobs>            
        <erpbridge_update>
            <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
            <run>
                <model>erpbridge/observer::method1</model>
            </run>
            
        </erpbridge_update>  
        <mss_erpbridge>
                <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
                <run>
            <model>erpbridge/observer::method2</model>
            </run>
            </mss_erpbridge>
        
        </jobs>
    </crontab>

Name space is Mss and module name is Erpbridge, Cron job with the right module name working perfectly <mss_erpbridge> but this is not working </erpbridge_update>. When I set the same key for both <mss_erpbridge> then only the second works.

My query :

Is it possible to set a cron job for multiple Models if yes, How?

Source Link
Deepak Mankotia
  • 593
  • 2
  • 14
  • 30

How to set-up a cron job for multiple models in magento?

I'm trying to set-up a cron job for multiple models. I have two methods (method1 and method2) in Model (observer.php) for which I want to set cron job. My code :

Config.xml file :

 <crontab>
        <jobs>            
        <erpbridge_update>
            <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
            <run>
                <model>erpbridge/observer::method1</model>
            </run>
            
        </erpbridge_update>  
        <mss_erpbridge>
                <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
                <run>
            <model>erpbridge/observer::method2</model>
            </run>
            </mss_erpbridge>
        
        </jobs>
    </crontab>

Name space is Mss and module name is Erpbridge, Corn with the right module name working perfectly <mss_erpbridge> but this is not working </erpbridge_update>. When I set the same key for both <mss_erpbridge> then only the second works.

My query :

Is it possible to set a cron job for multiple Models if yes, How?