9cecd754c369e384022ade77bf7b5c42ca58f010 — Christopher Vollick 11 months ago 85b356f
Find Bad Customers

This is meant to go through all customers who aren't already on sgx_jmp
and who don't already have an open porting request to get them there.
1 files changed, 23 insertions(+), 0 deletions(-)

A bin/find_bad_customers
A bin/find_bad_customers => bin/find_bad_customers +23 -0
@@ 0,0 1,23 @@
# frozen_string_literal: true

require "redis"
redis = Redis.new

raise "GIVE ME FILE" unless ARGV[0]

PORTING_NUMBERS = File.read(ARGV[0]).split("\n")

redis.scan_each(match: "catapult_jid-*", count: 1000) do |key|
	tel = key[13..-1]
	next if PORTING_NUMBERS.include? tel

	jid = redis.get(key)
	next if jid.start_with?("customer_")

	other_tel = redis.lindex("catapult_cred-#{jid}", -1)
	next unless other_tel
	next unless tel == other_tel

	puts jid