Fixed optional force app update for all apps when running remote load

This commit is contained in:
frikky
2020-07-22 16:58:54 +02:00
parent 1ea4a23381
commit 8db710a562
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -6144,7 +6144,7 @@ func handleAppHotload(location string) error {
} }
//log.Printf("Reading app folder: %#v", dir) //log.Printf("Reading app folder: %#v", dir)
err = iterateAppGithubFolders(fs, dir, "", "") err = iterateAppGithubFolders(fs, dir, "", "", false)
if err != nil { if err != nil {
log.Printf("Err: %s", err) log.Printf("Err: %s", err)
return err return err
@@ -6355,7 +6355,7 @@ func runInit(ctx context.Context) {
//iterateAppGithubFolders(fs, dir, "", "testing") //iterateAppGithubFolders(fs, dir, "", "testing")
// FIXME: Get all the apps? // FIXME: Get all the apps?
iterateAppGithubFolders(fs, dir, "", "") iterateAppGithubFolders(fs, dir, "", "", false)
// Hotloads locally // Hotloads locally
location := os.Getenv("APP_HOTLOAD_FOLDER") location := os.Getenv("APP_HOTLOAD_FOLDER")
+4 -4
View File
@@ -4265,7 +4265,7 @@ func loadSpecificApps(resp http.ResponseWriter, request *http.Request) {
log.Printf("FAiled reading folder: %s", err) log.Printf("FAiled reading folder: %s", err)
} }
_ = r _ = r
iterateAppGithubFolders(fs, dir, "", "") iterateAppGithubFolders(fs, dir, "", "", true)
} else if strings.Contains(tmpBody.URL, "s3") { } else if strings.Contains(tmpBody.URL, "s3") {
//https://docs.aws.amazon.com/sdk-for-go/api/service/s3/ //https://docs.aws.amazon.com/sdk-for-go/api/service/s3/
@@ -4490,7 +4490,7 @@ func iterateWorkflowGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra
} }
// Onlyname is used to // Onlyname is used to
func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra string, onlyname string) error { func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra string, onlyname string, forceUpdate bool) error {
var err error var err error
for _, file := range dir { for _, file := range dir {
if len(onlyname) > 0 && file.Name() != onlyname { if len(onlyname) > 0 && file.Name() != onlyname {
@@ -4508,7 +4508,7 @@ func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra strin
} }
// Go routine? Hmm, this can be super quick I guess // Go routine? Hmm, this can be super quick I guess
err = iterateAppGithubFolders(fs, dir, tmpExtra, "") err = iterateAppGithubFolders(fs, dir, tmpExtra, "", forceUpdate)
if err != nil { if err != nil {
log.Printf("Error reading folder: %s", err) log.Printf("Error reading folder: %s", err)
continue continue
@@ -4617,7 +4617,7 @@ func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra strin
} }
} }
if skip { if skip && !forceUpdate {
continue continue
} }