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

@ -76,7 +76,7 @@ type Database struct {
seekCompGauge metrics.Gauge // Gauge for tracking the number of table compaction caused by read opt seekCompGauge metrics.Gauge // Gauge for tracking the number of table compaction caused by read opt
quitLock sync.Mutex // Mutex protecting the quit channel access quitLock sync.Mutex // Mutex protecting the quit channel access
quitChan chan chan error // Quit channel to stop the metrics collection before closing the database quitChan chan struct{} // Quit channel to stop the metrics collection before closing the database
log log.Logger // Contextual logger tracking the database path 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, fn: file,
db: db, db: db,
log: logger, log: logger,
quitChan: make(chan chan error), quitChan: make(chan struct{}),
} }
ldb.compTimeMeter = metrics.NewRegisteredMeter(namespace+"compact/time", nil) ldb.compTimeMeter = metrics.NewRegisteredMeter(namespace+"compact/time", nil)
ldb.compReadMeter = metrics.NewRegisteredMeter(namespace+"compact/input", nil) ldb.compReadMeter = metrics.NewRegisteredMeter(namespace+"compact/input", nil)