fix(sched): 🚑 fix next_from for ShcedulingRule::Once
This commit is contained in:
parent
325f381aa4
commit
5293b26854
@ -33,10 +33,10 @@ impl SchedulingRule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 🧉 » get the next execution time from now
|
/// 🧉 » get the next execution time from now
|
||||||
pub fn next_from(&self, date: DateTime<Local>) -> Option<DateTime<Local>> {
|
pub fn next_from(&self, base: DateTime<Local>) -> Option<DateTime<Local>> {
|
||||||
match self {
|
match self {
|
||||||
SchedulingRule::Once(date) => {
|
SchedulingRule::Once(date) => {
|
||||||
if date > &date {
|
if date > &base {
|
||||||
Some(*date)
|
Some(*date)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
@ -44,7 +44,7 @@ impl SchedulingRule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "sched.rule-recurrence")]
|
#[cfg(feature = "sched.rule-recurrence")]
|
||||||
SchedulingRule::Repeat(rule) => rule.next_match_from(date),
|
SchedulingRule::Repeat(rule) => rule.next_match_from(base),
|
||||||
|
|
||||||
#[cfg(feature = "sched.rule-cron")]
|
#[cfg(feature = "sched.rule-cron")]
|
||||||
SchedulingRule::Cron(_cron) => {
|
SchedulingRule::Cron(_cron) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user