mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Reset PG connection if connection status is bad
This commit is contained in:
parent
ccadcb2e9d
commit
58f2375f75
1 changed files with 4 additions and 1 deletions
|
|
@ -39,7 +39,10 @@ class PostgresqlQueryService
|
|||
result = connection.exec(query_text)
|
||||
|
||||
rescue StandardError => e
|
||||
reset_connection(data_source) if connection&.finished?
|
||||
if connection&.status === PG::Constants::CONNECTION_BAD
|
||||
connection&.finish
|
||||
reset_connection(data_source)
|
||||
end
|
||||
|
||||
puts e
|
||||
error = { message: e.message }
|
||||
|
|
|
|||
Loading…
Reference in a new issue