Fix review comments: NextFilterId collisions

This commit is contained in:
Andrey Meshkov
2018-10-30 17:16:20 +03:00
parent 0e065a2e61
commit 54bdacdde2
5 changed files with 29 additions and 23 deletions

6
app.go
View File

@@ -303,8 +303,10 @@ func upgradeConfigSchema(oldVersion int, newVersion int) error {
filter := &config.Filters[i] // otherwise we will be operating on a copy
log.Printf("Seting ID=%d for filter %s", i, filter.URL)
filter.ID = i + 1 // start with ID=1
// Set the filter ID
log.Printf("Seting ID=%d for filter %s", NextFilterId, filter.URL)
filter.ID = NextFilterId
NextFilterId++
// Forcibly update the filter
_, err := filter.update(true)