Skip to content

Commit

Permalink
Update db.go
Browse files Browse the repository at this point in the history
Co-authored-by: Aoang <aoang@x2oe.com>
  • Loading branch information
vmihailenco and Aoang authored Jan 22, 2025
1 parent 8f0cb60 commit 06dd779
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,9 @@ func WithReadOnlyReplica(dbs ...*sql.DB) ReadWriteConnResolverOption {
}

func (r *ReadWriteConnResolver) Close() error {
r.closed.Store(true)
if r.closed.Swap(true) {
return nil
}

var firstErr error
for _, db := range r.replicas {
Expand Down

0 comments on commit 06dd779

Please sign in to comment.