coredns plugin -- Fix deadlock during coredns reload
This commit is contained in:
parent
0440ef016a
commit
2c84cd6448
|
@ -210,10 +210,10 @@ func (r *dayTop) addEntry(entry *logEntry, now time.Time) error {
|
||||||
func loadTopFromFiles() error {
|
func loadTopFromFiles() error {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
runningTop.RLock()
|
runningTop.RLock()
|
||||||
|
defer runningTop.RUnlock()
|
||||||
if runningTop.loaded {
|
if runningTop.loaded {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
defer runningTop.RUnlock()
|
|
||||||
onEntry := func(entry *logEntry) error {
|
onEntry := func(entry *logEntry) error {
|
||||||
err := runningTop.addEntry(entry, now)
|
err := runningTop.addEntry(entry, now)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue