update code

This commit is contained in:
2023-05-29 17:10:32 +08:00
parent c59d801434
commit 565bcca4f0
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -172,7 +172,7 @@ func matchPeriodPattern01(base time.Time, str string) (startimer.StarTimer, erro
now = now.Add(time.Duration(sr.Value) * time.Second)
}
}
return startimer.NewTimer(time.Now(), startimer.WithStaticDate(now), startimer.WithRunCountLimit(count)), nil
return startimer.NewTimer(time.Now(), startimer.WithStaticDate(now), startimer.WithRunCountLimit(count))
}
if duration.Seconds() > 0 {
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_SECOND, Value: uint32(duration.Seconds())})
@@ -180,7 +180,7 @@ func matchPeriodPattern01(base time.Time, str string) (startimer.StarTimer, erro
if rpt.Every == setAsDate {
rpt.Every = false
}
return startimer.NewTimer(base, startimer.WithRepeats(&rpt), startimer.WithRunCountLimit(count)), nil
return startimer.NewTimer(base, startimer.WithRepeats(&rpt), startimer.WithRunCountLimit(count))
}
return startimer.StarTimer{}, errors.New("no Match")
}
@@ -268,7 +268,7 @@ func matchPeroidPattern02(base time.Time, str string) (startimer.StarTimer, erro
if pts[1] != "" {
count = 0
}
return startimer.NewTimer(base, startimer.WithRepeats(&rpt), startimer.WithRunCountLimit(count)), nil
return startimer.NewTimer(base, startimer.WithRepeats(&rpt), startimer.WithRunCountLimit(count))
}
return startimer.StarTimer{}, errors.New("no Match")
}