find_bad_customers

 1#!/usr/bin/ruby
 2# frozen_string_literal: true
 3
 4require "redis"
 5redis = Redis.new
 6
 7raise "GIVE ME FILE" unless ARGV[0]
 8
 9PORTING_NUMBERS = File.read(ARGV[0]).split("\n")
10
11redis.scan_each(match: "catapult_jid-*", count: 1000) do |key|
12	tel = key[13..-1]
13	next if PORTING_NUMBERS.include? tel
14
15	jid = redis.get(key)
16	next if jid.start_with?("customer_")
17
18	other_tel = redis.lindex("catapult_cred-#{jid}", -1)
19	next unless other_tel
20	next unless tel == other_tel
21
22	puts jid
23end