remove package if state is not found

This commit is contained in:
Giovanni Harting 2024-03-10 13:15:18 +01:00
parent d9efab4d2a
commit 0ca90c55bf
1 changed files with 8 additions and 1 deletions

View File

@ -204,7 +204,14 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
rawState, err := os.ReadFile(filepath.Join(conf.Basedir.Work, stateDir, dbPkg.Repository.String()+"-"+conf.Arch, dbPkg.Pkgbase))
if err != nil {
log.Warningf("[HK] state not found for %s->%s: %v", fullRepo, dbPkg.Pkgbase, err)
log.Infof("[HK] state not found for %s->%s: %v, removing package", fullRepo, dbPkg.Pkgbase, err)
pkg := &ProtoPackage{
FullRepo: fullRepo,
PkgFiles: existingSplits,
March: march,
DBPackage: dbPkg,
}
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
continue
}