Actually possibly kinda decent cron next func

This commit is contained in:
Jef Roosens 2022-04-12 21:16:09 +02:00
parent e6033f9ab4
commit 1116fee3fc
Signed by untrusted user: Jef Roosens
GPG key ID: 2619CD13516CF9C4
3 changed files with 24 additions and 41 deletions

View file

@ -1,9 +1,7 @@
module cron
import git
import datatypes
import time
import rand
struct ScheduledBuild {
repo git.GitRepo
@ -15,12 +13,8 @@ fn (r1 ScheduledBuild) < (r2 ScheduledBuild) bool {
}
pub fn cron(conf Config) ? {
mut queue := datatypes.MinHeap<time.Time>{}
ce := parse_expression('0 3') ?
t := time.parse('2002-01-01 00:00:00') ?
println(t)
t2 := ce.next(t) ?
println(t2)
}