Skip to content

Commit 8eb4f85

Browse files
author
Guy Baron
authored
Merge pull request #91 from wework/fix-conn
closing rows when querying transactional outbox fails
2 parents 4adf30e + 58e1426 commit 8eb4f85

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gbus/tx/mysql/txoutbox.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ func (outbox *TxOutbox) sendMessages(recordSelector func(tx *sql.Tx) (*sql.Rows,
241241

242242
if selectErr != nil {
243243
outbox.log().WithError(selectErr).Error("failed fetching messages from outbox")
244-
244+
err := rows.Close()
245+
if err != nil {
246+
outbox.log().WithError(err).Error("could not close Rows")
247+
}
245248
return selectErr
246249
}
247250

0 commit comments

Comments
 (0)