Loading CHANGELOG.md +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Fixed - Correctly handle context cancellation in single-statement database operations. ## [2.1.3] - 2018-11-02 ### Added Loading server/db.go +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ func StatusError(code codes.Code, msg string, cause error) error { // Retry functions that perform non-transactional database operations. func ExecuteRetryable(fn func() error) error { if err := fn(); err != nil { if pqErr, ok := err.(*pq.Error); ok && pqErr.Code == "CR000" || pqErr.Code == "40001" { if pqErr, ok := err.(*pq.Error); ok && (pqErr.Code == "CR000" || pqErr.Code == "40001") { // A recognised error type that can be retried. return ExecuteRetryable(fn) } Loading Loading
CHANGELOG.md +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Fixed - Correctly handle context cancellation in single-statement database operations. ## [2.1.3] - 2018-11-02 ### Added Loading
server/db.go +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ func StatusError(code codes.Code, msg string, cause error) error { // Retry functions that perform non-transactional database operations. func ExecuteRetryable(fn func() error) error { if err := fn(); err != nil { if pqErr, ok := err.(*pq.Error); ok && pqErr.Code == "CR000" || pqErr.Code == "40001" { if pqErr, ok := err.(*pq.Error); ok && (pqErr.Code == "CR000" || pqErr.Code == "40001") { // A recognised error type that can be retried. return ExecuteRetryable(fn) } Loading