Browse Source

Delete indexer DB entries when (re)creating index (#3385)

* comment
tags/v1.4.0-rc1
Ethan Koenig Lauris BH 7 years ago
parent
commit
95cc1b78f4
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      models/repo_indexer.go

+ 7
- 0
models/repo_indexer.go View File

@@ -86,6 +86,13 @@ func populateRepoIndexerAsynchronously() error {
return nil
}

// if there is any existing repo indexer metadata in the DB, delete it
// since we are starting afresh. Also, xorm requires deletes to have a
// condition, and we want to delete everything, thus 1=1.
if _, err := x.Where("1=1").Delete(new(RepoIndexerStatus)); err != nil {
return err
}

var maxRepoID int64
if _, err = x.Select("MAX(id)").Table("repository").Get(&maxRepoID); err != nil {
return err


Loading…
Cancel
Save