嗨,我的 custom/Extension/modules/Schedulers/Ext/ScheduledTasks 文件夹中有一个调度程序,其文件名与我的函数名相同(fetch_account_pricing_info_from_recurly)
/* make the scheduler visable in the job creator */
array_push($job_strings, 'fetch_account_pricing_info_from_recurly');
function fetch_account_pricing_info_from_recurly(){
$GLOBALS['log']->fatal('my fatal message');
/* select all the active accounts */
$sql = "SELECT * FROM accounts INNER JOIN accounts_cstm ON accounts_cstm.id_c = accounts.id WHERE status_c = 'Active Customer'";
$result = $GLOBALS['db']->query($sql);
while($row = $GLOBALS['db']->fetchByAssoc($result)){
/* iterate over the accounts fetching the recurly subscription info from the SugarRecurlySyncService */
$account = BeanFactory::getBean('Accounts', $row['id']);
try{
$account->recurly_amount_c = 100;
$account->recurly_valid_c = true;
$account->save();
}catch(Exception $e){
}
}
return true;
}
我已经完成了快速构建和修复,以便其内容显示在 modules/Schedulers/ext/ScheduledTasks/scheduledtasks.ext.php
我已经基于这个调度程序创建了一个作业,它应该从管理界面每分钟运行一次,但是当我从命令行 php -f cron.php 运行 cron 作业时
我看到这条线与我的工作有关
Wed Sep 11 16:41:12 2013 [11966][1][DEBUG] process_full_list: Scheduler(641c28bd-44ad-0b02-f7ad-522e4e2abb93): name = Update Pricing
Wed Sep 11 16:41:12 2013 [11966][1][DEBUG] process_full_list: Scheduler(641c28bd-44ad-0b02-f7ad-522e4e2abb93): job = function::fetch_account_pricing_info_from_recurly
如果作业实际上正在运行,但我认为致命日志会显示在日志文件中。那么它为什么不运行呢?