mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Changed cron functions to allow inverse intervals
This commit is contained in:
parent
d1663cd242
commit
b5c5d631c6
@ -1480,7 +1480,7 @@ sub cron_next_execution {
|
|||||||
$nex_time = cron_next_execution_date ($cron, $nex_time, 0);
|
$nex_time = cron_next_execution_date ($cron, $nex_time, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $nex_time - time();
|
return $nex_time - $cur_time;
|
||||||
}
|
}
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Get the number of seconds left to the next execution of the given cron entry.
|
# Get the number of seconds left to the next execution of the given cron entry.
|
||||||
@ -1510,7 +1510,7 @@ sub cron_check_interval {
|
|||||||
if ($down < $up) {
|
if ($down < $up) {
|
||||||
return 0 if ($elem_curr_time < $down || $elem_curr_time > $up);
|
return 0 if ($elem_curr_time < $down || $elem_curr_time > $up);
|
||||||
} else {
|
} else {
|
||||||
return 0 if ($elem_curr_time > $down || $elem_curr_time < $up);
|
return 0 if ($elem_curr_time < $down && $elem_curr_time > $up);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -1675,7 +1675,7 @@ sub cron_is_in_cron {
|
|||||||
# * should returns floor data.
|
# * should returns floor data.
|
||||||
# 5 should returns 5.
|
# 5 should returns 5.
|
||||||
# 10-55 should returns 10.
|
# 10-55 should returns 10.
|
||||||
# 55-10 should retunrs floor data.
|
# 55-10 should retunrs elem_down.
|
||||||
################################################################################
|
################################################################################
|
||||||
sub cron_get_next_time_element {
|
sub cron_get_next_time_element {
|
||||||
# Default floor data is 0
|
# Default floor data is 0
|
||||||
@ -1683,7 +1683,7 @@ sub cron_get_next_time_element {
|
|||||||
$floor_data = 0 unless defined($floor_data);
|
$floor_data = 0 unless defined($floor_data);
|
||||||
|
|
||||||
my ($elem_down, $elem_up) = cron_get_interval ($curr_element);
|
my ($elem_down, $elem_up) = cron_get_interval ($curr_element);
|
||||||
return ($elem_down eq '*' || (defined($elem_up) && $elem_down > $elem_up))
|
return ($elem_down eq '*')
|
||||||
? $floor_data
|
? $floor_data
|
||||||
: $elem_down;
|
: $elem_down;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user