Skip to content

Commit

Permalink
fix logging error when db.Close fails
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz authored and hkalodner committed Sep 16, 2022
1 parent aa1c7fb commit 208d9d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions das/db_storage_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ func NewDBStorageService(ctx context.Context, dirPath string, discardAfterTimeou
ticker := time.NewTicker(5 * time.Minute)
defer ticker.Stop()
defer func() {
err := ret.db.Close()
log.Error("Failed to close DB", "err", err)
if err := ret.db.Close(); err != nil {
log.Error("Failed to close DB", "err", err)
}
}()
for {
select {
Expand Down

0 comments on commit 208d9d5

Please sign in to comment.