Skip to content

Commit

Permalink
Merge pull request #119 from imandra-ai/sam/fix-refreshing-dead-postg…
Browse files Browse the repository at this point in the history
…res-connections

Fix validation of dead connection in postgresql driver
  • Loading branch information
paurkedal authored Sep 2, 2024
2 parents 7e0cfd8 + 2cfa881 commit 50d26c7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions caqti-driver-postgresql/lib/caqti_driver_postgresql.ml
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,7 @@ struct
Caqti_error.pp_uri uri (Pg.string_of_error err))

let validate () = using_db @@ fun () ->
db#consume_input;
if (try db#status = Pg.Ok with Pg.Error _ -> false) then
if (try db#consume_input; db#status = Pg.Ok with Pg.Error _ -> false) then
Fiber.return true
else
reset ()
Expand Down

0 comments on commit 50d26c7

Please sign in to comment.