From f238598f8f78cb2e34b33341600982e33a73f04a Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 14 Jul 2021 19:54:46 -0500 Subject: [PATCH] Use PG connection pool --- sgx_jmp.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index b298c50..0c4a40f 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "pg/em" +require "pg/em/connection_pool" require "bigdecimal" require "blather/client/dsl" # Require this first to not auto-include require "blather/client" @@ -114,7 +114,7 @@ when_ready do BLATHER = self REDIS = EM::Hiredis.connect BTC_SELL_PRICES = BTCSellPrices.new(REDIS, CONFIG[:oxr_app_id]) - DB = PG::EM::Client.new(dbname: "jmp") + DB = PG::EM::ConnectionPool.new(dbname: "jmp") DB.type_map_for_results = PG::BasicTypeMapForResults.new(DB) DB.type_map_for_queries = PG::BasicTypeMapForQueries.new(DB) -- 2.38.5