mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/shed: rename prefix to metricsPrefix
This commit is contained in:
parent
9a90c999ac
commit
8ba97a02b2
1 changed files with 4 additions and 3 deletions
|
|
@ -63,8 +63,8 @@ type DB struct {
|
||||||
|
|
||||||
// NewDB constructs a new DB and validates the schema
|
// NewDB constructs a new DB and validates the schema
|
||||||
// if it exists in database on the given path.
|
// if it exists in database on the given path.
|
||||||
// prefix is used for metrics collection for the given DB.
|
// metricsPrefix is used for metrics collection for the given DB.
|
||||||
func NewDB(path string, prefix string) (db *DB, err error) {
|
func NewDB(path string, metricsPrefix string) (db *DB, err error) {
|
||||||
ldb, err := leveldb.OpenFile(path, &opt.Options{
|
ldb, err := leveldb.OpenFile(path, &opt.Options{
|
||||||
OpenFilesCacheCapacity: openFileLimit,
|
OpenFilesCacheCapacity: openFileLimit,
|
||||||
})
|
})
|
||||||
|
|
@ -89,7 +89,7 @@ func NewDB(path string, prefix string) (db *DB, err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
db.Meter(prefix)
|
db.Meter(metricsPrefix)
|
||||||
|
|
||||||
return db, nil
|
return db, nil
|
||||||
}
|
}
|
||||||
|
|
@ -151,6 +151,7 @@ func (db *DB) WriteBatch(batch *leveldb.Batch) (err error) {
|
||||||
|
|
||||||
// Close closes LevelDB database.
|
// Close closes LevelDB database.
|
||||||
func (db *DB) Close() (err error) {
|
func (db *DB) Close() (err error) {
|
||||||
|
close(db.quitChan)
|
||||||
return db.ldb.Close()
|
return db.ldb.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue