Fix review comments

This commit is contained in:
Andrey Meshkov
2019-02-11 14:22:36 +03:00
parent b477b67428
commit a40ddb094b
6 changed files with 21 additions and 15 deletions

View File

@@ -95,13 +95,10 @@ func refreshFiltersIfNecessary(force bool) int {
filter.ID = assignUniqueFilterID()
}
// Re-load it from the disk before updating
if len(filter.Rules) == 0 {
err := filter.load()
if err != nil {
log.Printf("Failed to reload filter %s: %s", filter.URL, err)
continue
}
// Try reloading filter from the disk before updating
// This is useful for the case when we simply enable a previously downloaded filter
_ = filter.load()
}
updated, err := filter.update(force)