def main(): domain_list = [] # domain_list = get_domain() domain_list = ['monogram.lv'] total_domain_count = len(domain_list) print total_domain_count count = 0 while count * THREADNUM < total_domain_count: domains = [] db = Database() domains = domain_list[count * THREADNUM: (count + 1) * THREADNUM] jobs = [gevent.spawn(check_domain, str(domain.strip())) for domain in domains] gevent.joinall(jobs, timeout=15) count = count + 1 db.insert_white_whois(jobs) db.close_db()
def main(): domain_list = [] # domain_list = get_domain() domain_list = ['monogram.lv'] total_domain_count = len(domain_list) print total_domain_count count = 0 while count * THREADNUM < total_domain_count: domains = [] db = Database() domains = domain_list[count * THREADNUM:(count + 1) * THREADNUM] jobs = [ gevent.spawn(check_domain, str(domain.strip())) for domain in domains ] gevent.joinall(jobs, timeout=15) count = count + 1 db.insert_white_whois(jobs) db.close_db()