Adding a missed rollback call (#803)

This commit is contained in:
Jesús Espino 2021-07-29 19:49:57 +02:00 committed by GitHub
parent 8823991eb9
commit bb81426b56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -411,6 +411,9 @@ func (s *SQLStore) InsertBlock(c store.Container, block *model.Block, userID str
if _, err2 := tx.Exec(q, args...); err2 != nil {
s.logger.Error(`InsertBlock error occurred while updating existing block`, mlog.String("blockID", block.ID), mlog.Err(err2))
if rollbackErr := tx.Rollback(); rollbackErr != nil {
s.logger.Warn("Transaction rollback error", mlog.Err(rollbackErr))
}
return err2
}
} else {