mirror of
https://github.com/prometheus/prometheus
synced 2024-12-27 17:13:22 +00:00
Merge "Fix LevelDB closing order."
This commit is contained in:
commit
8cadae6102
@ -260,12 +260,6 @@ func NewLevelDBPersistence(o LevelDBOptions) (*LevelDBPersistence, error) {
|
||||
func (l *LevelDBPersistence) Close() error {
|
||||
// These are deferred to take advantage of forced closing in case of stack
|
||||
// unwinding due to anomalies.
|
||||
defer func() {
|
||||
if l.storage != nil {
|
||||
l.storage.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
if l.filterPolicy != nil {
|
||||
l.filterPolicy.Close()
|
||||
@ -296,6 +290,12 @@ func (l *LevelDBPersistence) Close() error {
|
||||
}
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
if l.storage != nil {
|
||||
l.storage.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user