coredns plugin -- Fix deadlock during coredns reload

This commit is contained in:
Eugene Bujak 2018-10-08 14:18:19 +03:00
parent 0440ef016a
commit 2c84cd6448

View File

@ -210,10 +210,10 @@ func (r *dayTop) addEntry(entry *logEntry, now time.Time) error {
func loadTopFromFiles() error {
now := time.Now()
runningTop.RLock()
defer runningTop.RUnlock()
if runningTop.loaded {
return nil
}
defer runningTop.RUnlock()
onEntry := func(entry *logEntry) error {
err := runningTop.addEntry(entry, now)
if err != nil {