move log housekeeping to separate function

This commit is contained in:
2022-01-21 01:41:17 +01:00
parent b734d9bcb4
commit da6df92ed1
2 changed files with 11 additions and 3 deletions

View File

@@ -866,7 +866,7 @@ func housekeeping(repo string, wg *sync.WaitGroup) error {
}
// check all dbpackages for existence
dbpackages, err := db.DbPackage.Query().All(context.Background())
dbpackages, err := db.DbPackage.Query().Where(dbpackage.RepositoryEQ(dbpackage.Repository(repo))).All(context.Background())
if err != nil {
return err
}
@@ -889,6 +889,10 @@ func housekeeping(repo string, wg *sync.WaitGroup) error {
}
}
return nil
}
func logHK() error {
// check if package for log exists and if error can be fixed by rebuild
logFiles, err := Glob(filepath.Join(conf.Basedir.Repo, logDir, "/**/*.log"))
if err != nil {
@@ -927,7 +931,6 @@ func housekeeping(repo string, wg *sync.WaitGroup) error {
}
}
}
return nil
}