~singpolyma/sgx-jmp

13db0970d6c212a2aebb72efed8206b74a77daee — Stephen Paul Weber 2 years ago 35bce21
Set type map on *all* connections in pool
1 files changed, 4 insertions(+), 3 deletions(-)

M sgx_jmp.rb
M sgx_jmp.rb => sgx_jmp.rb +4 -3
@@ 116,9 116,10 @@ when_ready do
	BLATHER = self
	REDIS = EM::Hiredis.connect
	BTC_SELL_PRICES = BTCSellPrices.new(REDIS, CONFIG[:oxr_app_id])
	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)
	DB = PG::EM::ConnectionPool.new(dbname: "jmp") do |conn|
		conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn)
		conn.type_map_for_queries = PG::BasicTypeMapForQueries.new(conn)
	end

	EM.add_periodic_timer(3600) do
		ping = Blather::Stanza::Iq::Ping.new(:get, CONFIG[:server][:host])