Added golangci-lint configuration and prepared for the integrattion
This commit is contained in:
committed by
Eugene Bujak
parent
69a75fbcaa
commit
ec6b1f7c42
@@ -108,7 +108,12 @@ func logRequest(question *dns.Msg, answer *dns.Msg, result *dnsfilter.Result, el
|
||||
if len(flushBuffer) > 0 {
|
||||
// write to file
|
||||
// do it in separate goroutine -- we are stalling DNS response this whole time
|
||||
go flushToFile(flushBuffer)
|
||||
go func() {
|
||||
err := flushToFile(flushBuffer)
|
||||
if err != nil {
|
||||
log.Printf("Failed to flush the query log: %s", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -340,11 +340,11 @@ func HandleStatsHistory(w http.ResponseWriter, r *http.Request) {
|
||||
// check if start and time times are within supported time range
|
||||
timeRange := timeUnit * statsHistoryElements
|
||||
if startTime.Add(timeRange).Before(now) {
|
||||
http.Error(w, "start_time parameter is outside of supported range", 501)
|
||||
http.Error(w, "start_time parameter is outside of supported range", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if endTime.Add(timeRange).Before(now) {
|
||||
http.Error(w, "end_time parameter is outside of supported range", 501)
|
||||
http.Error(w, "end_time parameter is outside of supported range", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user