mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08: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 {
|
func (l *LevelDBPersistence) Close() error {
|
||||||
// These are deferred to take advantage of forced closing in case of stack
|
// These are deferred to take advantage of forced closing in case of stack
|
||||||
// unwinding due to anomalies.
|
// unwinding due to anomalies.
|
||||||
defer func() {
|
|
||||||
if l.storage != nil {
|
|
||||||
l.storage.Close()
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if l.filterPolicy != nil {
|
if l.filterPolicy != nil {
|
||||||
l.filterPolicy.Close()
|
l.filterPolicy.Close()
|
||||||
|
@ -296,6 +290,12 @@ func (l *LevelDBPersistence) Close() error {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
if l.storage != nil {
|
||||||
|
l.storage.Close()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue