Hotfix: can't create this until REDIS exists now

Stephen Paul Weber created

Change summary

sgx_jmp.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Detailed changes

sgx_jmp.rb 🔗

@@ -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) }