Fix clean and scan bugs (#846)

This commit is contained in:
InfiniteTF 2020-10-14 01:51:36 +02:00 committed by GitHub
parent 12cba97192
commit 482f8cbd92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -45,10 +45,11 @@ func CalculateMD5(path string) (string, error) {
}
func FileExists(path string) bool {
_, err := openSourceImage(path)
f, err := openSourceImage(path)
if err != nil {
return false
}
defer f.Close()
return true
}

View file

@ -656,6 +656,11 @@ func walkFilesToScan(s *models.StashConfig, f filepath.WalkFunc) error {
excludeImg := config.GetImageExcludes()
return symwalk.Walk(s.Path, func(path string, info os.FileInfo, err error) error {
if err != nil {
logger.Warnf("error scanning %s: %s", path, err.Error())
return nil
}
if info.IsDir() {
return nil
}