s = []
? ? request_user_remain_payamount_byweek = threadpool.makeRequests(user_remain_payamount_byweek, batch_week_list)
? ? request_user_remain_pay_byweek = threadpool.makeRequests(user_remain_pay_byweek, batch_week_list)
? ? requests.extend(request_user_remain_payamount_byweek)
? ? requests.extend(request_user_remain_pay_byweek)
? ? main_pool = threadpool.ThreadPool(8)
? ? [main_pool.putRequest(req) for req in requests]
if __name__ == '__main__':
? ? while True:
? ? ? ? try:
? ? ? ? ? ? time.sleep(960)
? ? ? ? ? ? main_pool.poll()
? ? ? ? except KeyboardInterrupt:
? ? ? ? ? ? print("**** Interrupted!")
? ? ? ? ? ? break
? ? ? ? except threadpool.NoResultsPending:
? ? ? ? ? ? break
? ? if main_pool.dismissedWorkers:
? ? ? ? print("Joining all dismissed worker threads...")
? ? ? ? main_pool.joinAllDismissedWorkers()
now_time = time.strftime('%Y-%m-%d %X', time.localtime())
print "当前时间是:",now_time