mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-11-09 05:26:56 +09:00
coredns plugin -- change rlock to lock when loading top stats to avoid doing it in parallel
This commit is contained in:
1 parent
2c84cd6448
commit
3109529dbb
1 file changed
+2
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user