fixed purging with no packages present to purge

This commit is contained in:
2022-05-20 12:46:10 +02:00
parent bcea0e99cb
commit bb16bdcb61
2 changed files with 9 additions and 3 deletions

View File

@@ -590,7 +590,7 @@ func housekeeping(repo string, march string, wg *sync.WaitGroup) error {
}
} else if dbPkg.Status == dbpackage.StatusLatest && dbPkg.RepoVersion == "" {
log.Infof("[HK] reseting missing package %s with no repo version", dbPkg.Pkgbase)
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearHash().ClearRepoVersion().SetUpdated(time.Now().UTC()).Exec(context.Background())
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearHash().ClearRepoVersion().Exec(context.Background())
if err != nil {
return err
}