* "refresh filters" HTTP handler: return the old synchronous behaviour

This was broken by "* dnsfilter: major refactoring"
This commit is contained in:
Simon Zolin
2019-10-10 17:12:32 +03:00
parent 3fbbda5102
commit c9d7bc3069
2 changed files with 29 additions and 16 deletions

View File

@@ -177,8 +177,14 @@ func handleFilteringSetRules(w http.ResponseWriter, r *http.Request) {
}
func handleFilteringRefresh(w http.ResponseWriter, r *http.Request) {
beginRefreshFilters()
fmt.Fprintf(w, "OK 0 filters updated\n")
config.controlLock.Unlock()
nUpdated, err := refreshFilters()
config.controlLock.Lock()
if err != nil {
httpError(w, http.StatusInternalServerError, "%s", err)
return
}
fmt.Fprintf(w, "OK %d filters updated\n", nUpdated)
}
type filterJSON struct {