ethdb/leveldb : lite struct of quit channel

This commit is contained in:
ucwong 2020-04-27 06:54:34 +00:00
parent 1eb42fef7a
commit a6f4d17446

View file

@ -75,8 +75,8 @@ type Database struct {
nonlevel0CompGauge metrics.Gauge // Gauge for tracking the number of table compaction in non0 level
seekCompGauge metrics.Gauge // Gauge for tracking the number of table compaction caused by read opt
quitLock sync.Mutex // Mutex protecting the quit channel access
quitChan chan chan error // Quit channel to stop the metrics collection before closing the database
quitLock sync.Mutex // Mutex protecting the quit channel access
quitChan chan struct{} // Quit channel to stop the metrics collection before closing the database
log log.Logger // Contextual logger tracking the database path
@ -115,7 +115,7 @@ func New(file string, cache int, handles int, namespace string) (*Database, erro
fn: file,
db: db,
log: logger,
quitChan: make(chan chan error),
quitChan: make(chan struct{}),
}
ldb.compTimeMeter = metrics.NewRegisteredMeter(namespace+"compact/time", nil)
ldb.compReadMeter = metrics.NewRegisteredMeter(namespace+"compact/input", nil)