forked from vieter-v/vieter
Started writing cron expression parser [CI SKIP]
This commit is contained in:
parent
e890128bda
commit
6d60ea1538
5 changed files with 91 additions and 1 deletions
|
|
@ -1,7 +1,32 @@
|
|||
module cron
|
||||
|
||||
import git
|
||||
import datatypes
|
||||
import time
|
||||
|
||||
struct ScheduledBuild {
|
||||
repo git.GitRepo
|
||||
timestamp time.Time
|
||||
}
|
||||
|
||||
fn (r1 ScheduledBuild) < (r2 ScheduledBuild) bool {
|
||||
return r1.timestamp < r2.timestamp
|
||||
}
|
||||
|
||||
pub fn cron(conf Config) ? {
|
||||
repos_map := git.get_repos(conf.address, conf.api_key) ?
|
||||
// mut queue := datatypes.MinHeap<ScheduledBuild>{}
|
||||
// repos_map := git.get_repos(conf.address, conf.api_key) ?
|
||||
|
||||
// for _, repo in repos_map {
|
||||
// scheduled := ScheduledBuild{
|
||||
// repo: repo
|
||||
// timestamp: 25
|
||||
// }
|
||||
|
||||
// queue.insert(scheduled)
|
||||
// }
|
||||
|
||||
// println(queue)
|
||||
exp := "10/2 5 *"
|
||||
println(parse_expression(exp) ?)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue