refactor: separated GitRepo types into own module

feat: added more query params for GitRepo API
This commit is contained in:
Jef Roosens 2022-05-19 07:54:33 +02:00
parent 5e81dadce3
commit 6bd5b7cb48
Signed by untrusted user: Jef Roosens
GPG key ID: B580B976584B5F30
12 changed files with 114 additions and 122 deletions

View file

@ -10,6 +10,7 @@ import docker
import db
import os
import client
import models { GitRepo }
const (
// How many seconds to wait before retrying to update API if failed
@ -20,7 +21,7 @@ const (
struct ScheduledBuild {
pub:
repo db.GitRepo
repo GitRepo
timestamp time.Time
}
@ -38,7 +39,7 @@ mut:
api_update_frequency int
image_rebuild_frequency int
// Repos currently loaded from API.
repos []db.GitRepo
repos []GitRepo
// At what point to update the list of repositories.
api_update_timestamp time.Time
image_build_timestamp time.Time
@ -149,7 +150,7 @@ pub fn (mut d Daemon) run() {
}
// schedule_build adds the next occurence of the given repo build to the queue.
fn (mut d Daemon) schedule_build(repo db.GitRepo) {
fn (mut d Daemon) schedule_build(repo GitRepo) {
ce := if repo.schedule != '' {
parse_expression(repo.schedule) or {
// TODO This shouldn't return an error if the expression is empty.