mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-07 20:40:44 +00:00
Reorganize the lock to make the comment more explanatory.
This commit is contained in:
@@ -72,10 +72,10 @@ func (lg *Log) Add(etype string, data types.EventData) error {
|
||||
lg.updateHead(head)
|
||||
size := lg.numItems
|
||||
age := head.item.Cursor.Diff(lg.oldestCursor)
|
||||
lg.mu.Unlock()
|
||||
|
||||
// If the log requires pruning, do the pruning step outside the lock. This
|
||||
// permits readers to continue to make progress while we're working.
|
||||
lg.mu.Unlock()
|
||||
return lg.checkPrune(head, size, age)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user