【问题标题】:Why does magento generate two same cron jobs?为什么 magento 会生成两个相同的 cron 作业?
【发布时间】:2013-01-14 01:12:33
【问题描述】:

crontab:每5分钟运行一次cron.php;

config.xml

<crontab>
    <jobs>
            <newsletter_send_all>
                <schedule><cron_expr>20 2 * * *</cron_expr></schedule>
                    <run><model>psteal/observer_psteal::updatefrommagento</model></run>
            </newsletter_send_all> 
    </jobs>
</crontab>

DB ,TABLE 中生成的数据是 cron_schedule:

job_code 状态消息 created_at scheduled_at

newsletter_send_all 未决 NULL 2013-01-25 02:18:46 2013-01-25 02:20:00

newsletter_send_all 未决 NULL 2013-01-25 02:18:46 2013-01-25 02:27:00

我不知道为什么magento会生成两个相同的cron作业?应该只有一个作业(在2013-01-25 02:20:00),有什么想法吗?

【问题讨论】:

    标签: magento cron


    【解决方案1】:

    例如,尝试将 cron 任务名称从 newsletter_send_all 更改为 psteal_newsletter_send_all,因为 newsletter_send_all 已在 app/code/core/Mage/Newsletter/etc/config 中定义。 xml

    【讨论】:

    • 我把名字从 newsletter_send_all 改成了 psteal_newsletter_send_all ,还是一样的错误;其实我只是举个类似 newsletter_send_all 的例子,其他任务也会生成两个相同的 cron 作业,不知道为什么?
    • 所有任务产生相差7分钟的双重任务?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-17
    • 2018-05-21
    • 1970-01-01
    • 2016-03-18
    • 1970-01-01
    • 1970-01-01
    • 2011-08-18
    相关资源
    最近更新 更多