def main(): global my_headers my_headers = com_tools.get_mayi_Headers() for i in range(com_tools.tag_thread_num): t = threading.Thread(target=process, name='look_my_header') t.start() t.join(0.1)
def main(): global my_headers my_headers = com_tools.get_mayi_Headers() st = time.time() thread_start() ed = time.time() print(ed - st)
def look_my_header(): """ 监控蚂蚁的header 半小时更新一次 :return: """ while True: time.sleep(60 * 30) global my_headers my_headers = com_tools.get_mayi_Headers()
def look_my_header(): """ 监控蚂蚁的header 半小时更新一次 :return: """ for i in range(8): time.sleep(60 * 30) global my_headers my_headers = com_tools.get_mayi_Headers()
def start(): global my_headers my_headers = com_tools.get_mayi_Headers() # t = threading.Thread(target=look_my_header, name='look_my_header') # t.start() # t.join(0.1) crawl_city() crawl_bc()
def main(): # while True: # try: # run() # except Exception as e: # print(e) set_room_queue() mayi_Headers = com_tools.get_mayi_Headers() time.sleep(60) start(mayi_Headers)
def __init__(self): """{"lodge_id": row.lodge_id, "room_id": row.room_id, "third_type": row.third_type, "state": row.state, "city": row.short_name}""" self.all_room_queue = com_tools.get_all_room_queue() self.my_headers = com_tools.get_mayi_Headers()