mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Remove unnecessary error from ToggleCompaction fns
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
parent
261cd9f393
commit
ff4ccb6eb0
8
db.go
8
db.go
|
@ -531,25 +531,21 @@ func (db *DB) Close() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableCompactions disables compactions.
|
// DisableCompactions disables compactions.
|
||||||
func (db *DB) DisableCompactions() error {
|
func (db *DB) DisableCompactions() {
|
||||||
if db.compacting {
|
if db.compacting {
|
||||||
db.cmtx.Lock()
|
db.cmtx.Lock()
|
||||||
db.compacting = false
|
db.compacting = false
|
||||||
db.logger.Log("msg", "compactions disabled")
|
db.logger.Log("msg", "compactions disabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableCompactions enables compactions.
|
// EnableCompactions enables compactions.
|
||||||
func (db *DB) EnableCompactions() error {
|
func (db *DB) EnableCompactions() {
|
||||||
if !db.compacting {
|
if !db.compacting {
|
||||||
db.cmtx.Unlock()
|
db.cmtx.Unlock()
|
||||||
db.compacting = true
|
db.compacting = true
|
||||||
db.logger.Log("msg", "compactions enabled")
|
db.logger.Log("msg", "compactions enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Snapshot writes the current data to the directory.
|
// Snapshot writes the current data to the directory.
|
||||||
|
|
Loading…
Reference in a new issue