From e5c78de08f9c5566008a7c4081a9934465496964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20B=C3=BClow?= Date: Fri, 2 Feb 2024 10:41:51 +0100 Subject: [PATCH] now re-pulls Image regularily --- pods/manager.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pods/manager.go b/pods/manager.go index 7925d4c..bb7b5c2 100644 --- a/pods/manager.go +++ b/pods/manager.go @@ -41,15 +41,19 @@ func ConnectSocket() { } func PullImage() error { - log.Println("Downloading Container image ", viper.GetString("image")) - image := viper.GetString("image") - conn := Socket - _, err := images.Pull(conn, image, nil) - if err != nil { - log.Println(err) - return err + for { + log.Println("Downloading Container image ", viper.GetString("image")) + image := viper.GetString("image") + conn := Socket + _, err := images.Pull(conn, image, nil) + if err != nil { + log.Println(err) + return err + } + + time.Sleep(1 * time.Hour) } - return nil + } // Cleanup deletes Containers older than the specified maximum Age (Equal to session cookie maximum age)