no_panic_be_happy (#1586)

This commit is contained in:
Alex Sharov 2021-03-22 22:45:24 +07:00 committed by GitHub
parent 91e4126ca7
commit 4c82b15c36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -356,7 +356,7 @@ func (db *LmdbKV) CollectMetrics() {
tableGcEntries.Update(int64(stat.Entries)) tableGcEntries.Update(int64(stat.Entries))
return nil return nil
}); err != nil { }); err != nil {
panic(err) log.Error("collecting metrics failed", "err", err)
} }
} }

View File

@ -344,7 +344,7 @@ func (db *MdbxKV) CollectMetrics() {
tableGcEntries.Update(int64(stat.Entries)) tableGcEntries.Update(int64(stat.Entries))
return nil return nil
}); err != nil { }); err != nil {
panic(err) log.Error("collecting metrics failed", "err", err)
} }
} }

View File

@ -347,7 +347,7 @@ func (db *ObjectDatabase) NewBatch() DbWithPendingMutations {
func (db *ObjectDatabase) Begin(ctx context.Context, flags TxFlags) (DbWithPendingMutations, error) { func (db *ObjectDatabase) Begin(ctx context.Context, flags TxFlags) (DbWithPendingMutations, error) {
batch := &TxDb{db: db} batch := &TxDb{db: db}
if err := batch.begin(ctx, flags); err != nil { if err := batch.begin(ctx, flags); err != nil {
panic(err) return batch, err
} }
return batch, nil return batch, nil
} }