我想在我的模块中设置一个cron作业,但我的cron作业根本就没有执行。
应用/代码/本地/ Winback /电子邮件的/ etc / config.xml中
<?xml version="1.0"?>
<config>
<modules>
<Winback_Email>
<version>0.1.30</version>
</Winback_Email>
</modules>
<global>
<models>
<Winback_Email>
<class>Winback_Email_Model</class>
</Winback_Email>
</models>
</global>
<crontab>
<jobs>
<Winback_Email>
<schedule>
<cron_expr>*/1 * * * *</cron_expr>
</schedule>
<run>
<model>email/observer::setlog</model>
</run>
</Winback_Email>
</jobs>
</crontab>
</config>
**app/code/local/Winback/Email/Model/Observer.php**
<?php
class Winback_Email_Model_Observer extends Mage_Core_Model_Abstract
{
public function setlog($observer)
{
Mage::log('changed log by cron', null, 'mylogfile.log');
return $observer;
}
}
我已经安装了一个Cron Scheduler Module,它将错误显示为异常Mage_Core_Exception
并带有消息
'Invalid callback: email/observer::setlog does not exist' in /home/leosatyen/webapps/AbandonCart/app/Mage.php:595
答案 0 :(得分:0)
应该是:
<run>
<model>Winback_Email/observer::setlog</model>
</run>
&#13;
因为您的模型组名称不是电子邮件,而是Winback_Email。