~singpolyma/sgx-jmp

589ab72aa18e78a8ea4e9079d0f9bedffe1eafeb — Stephen Paul Weber 1 year, 29 days ago f68da9c
Hotfix: can't create this until REDIS exists now
1 files changed, 3 insertions(+), 3 deletions(-)

M sgx_jmp.rb
M sgx_jmp.rb => sgx_jmp.rb +3 -3
@@ 169,6 169,7 @@ when_ready do
	LOG.info "Ready"
	BLATHER = self
	REDIS = EM::Hiredis.connect
	WEB_REGISTER_MANAGER = WebRegisterManager.new
	BTC_SELL_PRICES = BTCSellPrices.new(REDIS, CONFIG[:oxr_app_id])
	DB = PG::EM::ConnectionPool.new(dbname: "jmp") do |conn|
		conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn)


@@ 305,7 306,6 @@ COMMAND_MANAGER = SessionManager.new(
	timeout: 60 * 60,
	error_if: ->(s) { s.cancel? }
)
web_register_manager = WebRegisterManager.new

disco_info to: Blather::JID.new(CONFIG[:component][:jid]) do |iq|
	reply = iq.reply


@@ 392,7 392,7 @@ Command.new(
		Command.execution.customer_repo.create(Command.execution.iq.from.stripped)
	}.then { |customer|
		Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Registration.for"))
		Registration.for(customer, web_register_manager).then(&:write)
		Registration.for(customer, WEB_REGISTER_MANAGER).then(&:write)
	}.then {
		StatsD.increment("registration.completed")
	}.catch_only(Command::Execution::FinalStanza) do |e|


@@ 547,7 547,7 @@ command :execute?, node: "web-register", sessionid: nil do |iq|
				cmd.form.fields = [var: "to", value: jid]
				cmd.form.type = "submit"
			}).then { |result|
				web_register_manager.set(result.form.field("from")&.value.to_s.strip, tel)
				WEB_REGISTER_MANAGER.set(result.form.field("from")&.value.to_s.strip, tel)
			}.then {
				BLATHER << iq.reply.tap { |reply| reply.status = :completed }
			}.catch { |e| panic(e, sentry_hub) }