From 9cecd754c369e384022ade77bf7b5c42ca58f010 Mon Sep 17 00:00:00 2001 From: Christopher Vollick <0@psycoti.ca> Date: Mon, 30 Aug 2021 10:48:40 -0400 Subject: [PATCH] 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. --- bin/find_bad_customers | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 bin/find_bad_customers diff --git a/bin/find_bad_customers b/bin/find_bad_customers new file mode 100644 index 0000000000000000000000000000000000000000..3e552b3ecce00b8b028d86b905be5b3332364af1 --- /dev/null +++ b/bin/find_bad_customers @@ -0,0 +1,23 @@ +#!/usr/bin/ruby +# 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 +end