【发布时间】:2015-12-31 15:52:55
【问题描述】:
所以我知道如何使用 config.xml crontab 来设置 cron:
<crontab>
<jobs>
<millena_export_send_all>
<schedule><cron_expr>* * * * *</cron_expr></schedule>
<run><model>millena_export/observer::exportOrderData</model></run>
</millena_export_send_all>
</jobs>
</crontab>
但我感到困惑的是如何使 cron_expr 成为可以更改的后端设置(每 5 分钟、每 10 分钟等)。我想我可以使用 backend_model 然后在 after_save 方法中我可以执行 setStoreConfig('path/to/schedule/cron_expr', '*/5 * * * *') 或类似的东西,它将保存在缓存。我的想法正确吗?有没有更好的方法来做到这一点?
【问题讨论】:
标签: magento