mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Remove unnecessary locks
Compact() is an uppercase function that deals with locks on its own, so we shouldn't have a lock around it. Signed-off-by: Lukasz Mierzwa <lukasz@cloudflare.com>
This commit is contained in:
parent
d106b3beb7
commit
a1740cd2e7
|
@ -1518,9 +1518,7 @@ func (db *DB) compactBlocks() (err error) {
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
db.mtx.RLock()
|
|
||||||
uids, err := db.compactor.Compact(db.dir, plan, db.blocks)
|
uids, err := db.compactor.Compact(db.dir, plan, db.blocks)
|
||||||
db.mtx.RUnlock()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("compact %s: %w", plan, err)
|
return fmt.Errorf("compact %s: %w", plan, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue