cron: filter out repos with wrong architecture

dev
Jef Roosens 2022-05-06 08:31:59 +02:00
parent 7fdbcdf3e7
commit a3b6680153
Signed by untrusted user: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import math
import build import build
import docker import docker
import db import db
import os
const ( const (
// How many seconds to wait before retrying to update API if failed // How many seconds to wait before retrying to update API if failed
@ -19,7 +20,6 @@ const (
struct ScheduledBuild { struct ScheduledBuild {
pub: pub:
repo_id string
repo db.GitRepo repo db.GitRepo
timestamp time.Time timestamp time.Time
} }
@ -187,6 +187,10 @@ fn (mut d Daemon) renew_repos() {
return return
} }
// Filter out any repos that shouldn't run on this architecture
cur_arch := os.uname().machine
new_repos = new_repos.filter(it.arch.any(it.value == cur_arch))
d.repos = new_repos d.repos = new_repos
d.api_update_timestamp = time.now().add_seconds(60 * d.api_update_frequency) d.api_update_timestamp = time.now().add_seconds(60 * d.api_update_frequency)