I wonder if it's possible to limit DB connections to 1 or same connection with thread without raising connection pool error which we mainly use for parallel HTTP requests but might cause extra connection leaks if we wrap something more than just HTTP connections.
Ex.
class ExampleExecutor
def self.process(url, shipment = nil)
response = HTTParty.post(url)
# Don't want this one to open new connection, it's ok to share with the top level DB connection
shipment.touch if shipment
response
end
end
responses = Parallel.map([url1, url2, url3]) do |url|
ExampleExecutor.process(url, shipment)
end
Hi all,
I wonder if it's possible to limit DB connections to
1
or same connection with thread without raising connection pool error which we mainly use for parallel HTTP requests but might cause extra connection leaks if we wrap something more than just HTTP connections.Ex.