试试解决方法吧:
我查看了,UChome\source\function_cron.php 有个函数
//下次执行的时间
function cronnextrun($cron) {
global $_SGLOBAL, $_SCONFIG;
if(empty($cron)) return FALSE;
list($yearnow, $monthnow, $daynow, $weekdaynow, $hournow, $minutenow) = explode('-', sgmdate('Y-m-d-w-H-i', $_SGLOBAL['timestamp']));
$cron['minute'] = explode("\t", $cron['minute']);
if($cron['weekday'] == -1) {
if($cron['day'] == -1) {
$firstday = $daynow;
$secondday = $daynow + 1;
} else {
$firstday = $cron['day'];
$secondday = $cron['day'] + sgmdate('t', $_SGLOBAL['timestamp']);
}
} else {
$firstday = $daynow + ($cron['weekday'] - $weekdaynow);
$secondday = $firstday + 7;
}
if($firstday < $daynow) {
$firstday = $secondday;
}
if($firstday == $daynow) {
$todaytime = crontodaynextrun($cron);
if($todaytime['hour'] == -1 && $todaytime['minute'] == -1) {
$cron['day'] = $secondday;
$nexttime = crontodaynextrun($cron, 0, -1);
$cron['hour'] = $nexttime['hour'];
$cron['minute'] = $nexttime['minute'];
} else {
$cron['day'] = $firstday;
$cron['hour'] = $todaytime['hour'];
$cron['minute'] = $todaytime['minute'];
}
} else {
$cron['day'] = $firstday;
$nexttime = crontodaynextrun($cron, 0, -1);
$cron['hour'] = $nexttime['hour'];
$cron['minute'] = $nexttime['minute'];
}
//更新下次运行时间
$nextrun = @gmmktime($cron['hour'], $cron['minute'], 0, $monthnow, $cron['day'], $yearnow) - $_SCONFIG['timeoffset'] * 3600;
$setarr = array(
'lastrun' => $_SGLOBAL['timestamp'],
'nextrun' => $nextrun
);
if($nextrun <= $_SGLOBAL['timestamp']) {
$setarr['available'] = 0;
}
updatetable('cron', $setarr, array('cronid'=>$cron['cronid']));
return TRUE;
}
可能是执行的时候偶尔会出错,程序判断,然后自动关闭吧,所以把红色部分取消大家再试试应该没问题了!! |