forked from vieter-v/vieter
Actually possibly kinda decent cron next func
This commit is contained in:
parent
e6033f9ab4
commit
1116fee3fc
3 changed files with 24 additions and 41 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue