mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-28 14:47:16 +00:00
don't start tx on shutdown (#56)
This commit is contained in:
parent
3b7a086a68
commit
b1435d3679
@ -334,14 +334,14 @@ func (db *MdbxKV) Close() {
|
||||
}
|
||||
|
||||
func (db *MdbxKV) BeginRo(ctx context.Context) (txn kv.Tx, err error) {
|
||||
if db.env == nil {
|
||||
return nil, fmt.Errorf("db closed")
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
default:
|
||||
}
|
||||
if db.env == nil {
|
||||
return nil, fmt.Errorf("db closed")
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user