2022-04-09 09:46:07 +02:00
|
|
|
module cron
|
|
|
|
|
|
|
|
import git
|
2022-04-10 16:17:50 +02:00
|
|
|
import time
|
|
|
|
|
|
|
|
struct ScheduledBuild {
|
2022-04-10 16:48:37 +02:00
|
|
|
repo git.GitRepo
|
2022-04-10 16:17:50 +02:00
|
|
|
timestamp time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
fn (r1 ScheduledBuild) < (r2 ScheduledBuild) bool {
|
|
|
|
return r1.timestamp < r2.timestamp
|
|
|
|
}
|
2022-04-09 09:46:07 +02:00
|
|
|
|
|
|
|
pub fn cron(conf Config) ? {
|
2022-04-12 14:22:40 +02:00
|
|
|
ce := parse_expression('0 3') ?
|
|
|
|
t := time.parse('2002-01-01 00:00:00') ?
|
|
|
|
t2 := ce.next(t) ?
|
|
|
|
println(t2)
|
2022-04-09 09:46:07 +02:00
|
|
|
}
|