mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid nil DataBackend
This commit is contained in:
parent
555413d9fc
commit
757c7d67ad
|
@ -91,8 +91,10 @@ func (v *Volume) CommitCompact() error {
|
||||||
|
|
||||||
glog.V(3).Infof("Got volume %d committing lock...", v.Id)
|
glog.V(3).Infof("Got volume %d committing lock...", v.Id)
|
||||||
v.nm.Close()
|
v.nm.Close()
|
||||||
if err := v.DataBackend.Close(); err != nil {
|
if v.DataBackend != nil {
|
||||||
glog.V(0).Infof("fail to close volume %d", v.Id)
|
if err := v.DataBackend.Close(); err != nil {
|
||||||
|
glog.V(0).Infof("fail to close volume %d", v.Id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
v.DataBackend = nil
|
v.DataBackend = nil
|
||||||
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec()
|
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec()
|
||||||
|
|
Loading…
Reference in a new issue