Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
UB-1761 - Changed order of defer function to avoid iterating and upda…
Browse files Browse the repository at this point in the history
…ting map at same time. (#282)

Fixing error concurrent map iteration and map write error
  • Loading branch information
deeghuge authored and olgashtivelman committed Dec 13, 2018
1 parent 123decb commit f422ef2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/locker.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func (l *locker) updateStats(name string) {
defer l.logger.Trace(logs.DEBUG, logs.Args{{"lockName", name}})()

l.statsLock.Lock()
defer l.cleanup()
defer l.statsLock.Unlock()
defer l.cleanup()
if stat, exists := l.stats[name]; exists {
stat = time.Now()
l.stats[name] = stat
Expand Down

0 comments on commit f422ef2

Please sign in to comment.