mirror of
https://github.com/ulfgebhardt/system.git
synced 2025-12-13 09:35:49 +00:00
cron fixes, time is now based on last run not now()
This commit is contained in:
parent
71825f11a5
commit
51f12b4ce8
@ -41,11 +41,12 @@ class cron {
|
||||
if(!self::check($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS])){
|
||||
throw new \SYSTEM\LOG\ERROR("Given class is not a cronjob");}
|
||||
//time
|
||||
return \SYSTEM\CRON\crontime::next_now( $cron[\SYSTEM\DBD\system_cron::FIELD_MIN],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_HOUR],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY_WEEK],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_MONTH]);
|
||||
return \SYSTEM\CRON\crontime::next( strtotime($cron[\SYSTEM\DBD\system_cron::FIELD_LAST_RUN]),
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_MIN],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_HOUR],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY_WEEK],
|
||||
$cron[\SYSTEM\DBD\system_cron::FIELD_MONTH]);
|
||||
}
|
||||
|
||||
private static function status($class, $status){
|
||||
|
||||
@ -20,6 +20,9 @@ class crontime {
|
||||
$day_week = $day_week % 6; // 7 and 0 both mean Sunday
|
||||
$now_day_week = $now_day_week % 6; // 7 and 0 both mean Sunday
|
||||
$next_day += abs($day_week - $now_day_week);}
|
||||
new \SYSTEM\LOG\INFO(print_r(array($base_time,$min,$hour,$day,$day_week,$month),true));
|
||||
new \SYSTEM\LOG\INFO(print_r(array($now_min, $now_hour, $now_day, $now_month, $now_day_week),true));
|
||||
new \SYSTEM\LOG\INFO(print_r(array($next_hour, $next_min, 0, $next_month, $next_day, $next_year),true));
|
||||
return mktime($next_hour, $next_min, 0, $next_month, $next_day, $next_year);
|
||||
}
|
||||
public static function last($base_time,$min,$hour,$day,$day_week,$month){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user