我创建了一个 Magento 扩展,它使用 Magento 的内置 cron 功能每 5 分钟左右运行一次任务,但我不能让它工作。
我的扩展配置(etc/config.xml):
<config>
...
<crontab>
<jobs>
<featuredtopics_getnewtopics>
<schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
<run><model>featuredtopics/cron::getNewTopics</model></run>
</featuredtopics_getnewtopics>
</jobs>
</crontab>
</config>
我的扩展 cron 模型(Model/Cron.php):
class Sodapop_Featuredtopics_Model_Cron {
public function getNewTopics() {
// Stuff
}
}
cron 工作似乎开始得很好,但它永远不会结束。我支持退货吗?
编辑 经过仔细检查,我发现我的脚本中有错误。