Commit 920f7fe1 authored by litaolemo's avatar litaolemo

update

parent 0fbf3c67
......@@ -141,8 +141,8 @@ def get_task_from_redis():
while True:
try:
now = datetime.datetime.now()
if now.hour >= exit_hour:
sys.exit()
# if now.hour >= exit_hour:
# sys.exit()
res = rds_1.hgetall("process_num")
for platform in platform_crawler_reg:
platform_str = platform + "_process"
......@@ -170,8 +170,8 @@ def single_thead(processe,name):
data_list = []
while True:
now = datetime.datetime.now()
if now.hour >= exit_hour:
sys.exit()
# if now.hour >= exit_hour:
# sys.exit()
end_time = int(now.timestamp() * 1e3)
for count, platform in enumerate(get_task_from_redis()):
now = datetime.datetime.now()
......@@ -267,10 +267,10 @@ if __name__ == "__main__":
future = executor.submit(start_crawler,processe,name)
futures.append(future)
print('Processe %s start' % processe)
while True:
now = datetime.datetime.now()
if now.hour >= exit_hour:
for future in futures:
future.cancel()
sys.exit()
# while True:
# now = datetime.datetime.now()
# if now.hour >= exit_hour:
# for future in futures:
# future.cancel()
# sys.exit()
# singel_thead("1")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment