Compare commits
1 Commits
aaef057347
...
0604de26c4
Author | SHA1 | Date |
---|---|---|
|
0604de26c4 |
|
@ -83,7 +83,7 @@ pub fn (mut d AgentDaemon) run() {
|
||||||
// Make sure a recent build base image is available for
|
// Make sure a recent build base image is available for
|
||||||
// building the config
|
// building the config
|
||||||
if !d.images.up_to_date(config.base_image) {
|
if !d.images.up_to_date(config.base_image) {
|
||||||
d.linfo("Building builder image from base image $config.base_image")
|
d.linfo('Building builder image from base image $config.base_image')
|
||||||
|
|
||||||
// TODO handle this better than to just skip the config
|
// TODO handle this better than to just skip the config
|
||||||
d.images.refresh_image(config.base_image) or {
|
d.images.refresh_image(config.base_image) or {
|
||||||
|
|
|
@ -33,11 +33,12 @@ pub fn (m &ImageManager) get(base_image string) string {
|
||||||
return m.images[base_image].last()
|
return m.images[base_image].last()
|
||||||
}
|
}
|
||||||
|
|
||||||
// outdated returns whether the last known builder image is exists and is up to
|
// up_to_date returns whether the last known builder image is exists and is up
|
||||||
// date. If this function returns true, the last builder image may be used to
|
// to date. If this function returns true, the last builder image may be used
|
||||||
// perform a build.
|
// to perform a build.
|
||||||
pub fn (mut m ImageManager) up_to_date(base_image string) bool {
|
pub fn (mut m ImageManager) up_to_date(base_image string) bool {
|
||||||
if base_image !in m.timestamps || m.timestamps[base_image].add_seconds(m.max_image_age) <= time.now() {
|
if base_image !in m.timestamps
|
||||||
|
|| m.timestamps[base_image].add_seconds(m.max_image_age) <= time.now() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue