lib/empty_repo.rb 🔗
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+class EmptyRepo
+ def find(*); end
+end
Stephen Paul Weber created
Since this is used by the billing cronjob and hitting BW so much is too expensive.
lib/empty_repo.rb | 5 +++++
sgx_jmp.rb | 6 +++++-
2 files changed, 10 insertions(+), 1 deletion(-)
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+class EmptyRepo
+ def find(*); end
+end
@@ -82,6 +82,7 @@ require_relative "lib/customer"
require_relative "lib/customer_info_form"
require_relative "lib/customer_repo"
require_relative "lib/electrum"
+require_relative "lib/empty_repo"
require_relative "lib/expiring_lock"
require_relative "lib/em"
require_relative "lib/form_to_h"
@@ -725,7 +726,10 @@ Command.new(
reply.allowed_actions = [:next]
reply.command << FormTemplate.render("customer_picker")
}.then { |response|
- CustomerInfoForm.new.find_customer(response)
+ CustomerInfoForm.new(CustomerRepo.new(
+ sgx_repo: Bwmsgsv2Repo.new,
+ bandwidth_tn_repo: EmptyRepo.new # No CNAM in admin
+ )).find_customer(response)
}.then do |target_customer|
AdminCommand.new(target_customer).start
end