mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-03-14 22:48:35 +03:00
coredns plugin -- change rlock to lock when loading top stats to avoid doing it in parallel
This commit is contained in:
parent
2c84cd6448
commit
3109529dbb
1 changed files with 2 additions and 2 deletions
|
@ -209,8 +209,8 @@ func (r *dayTop) addEntry(entry *logEntry, now time.Time) error {
|
|||
|
||||
func loadTopFromFiles() error {
|
||||
now := time.Now()
|
||||
runningTop.RLock()
|
||||
defer runningTop.RUnlock()
|
||||
runningTop.Lock() // not rlock because we set it at the end of the function
|
||||
defer runningTop.Unlock()
|
||||
if runningTop.loaded {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue