Commit 920f7fe1 authored by litaolemo's avatar litaolemo

update

parent 0fbf3c67
...@@ -141,8 +141,8 @@ def get_task_from_redis(): ...@@ -141,8 +141,8 @@ def get_task_from_redis():
while True: while True:
try: try:
now = datetime.datetime.now() now = datetime.datetime.now()
if now.hour >= exit_hour: # if now.hour >= exit_hour:
sys.exit() # sys.exit()
res = rds_1.hgetall("process_num") res = rds_1.hgetall("process_num")
for platform in platform_crawler_reg: for platform in platform_crawler_reg:
platform_str = platform + "_process" platform_str = platform + "_process"
...@@ -170,8 +170,8 @@ def single_thead(processe,name): ...@@ -170,8 +170,8 @@ def single_thead(processe,name):
data_list = [] data_list = []
while True: while True:
now = datetime.datetime.now() now = datetime.datetime.now()
if now.hour >= exit_hour: # if now.hour >= exit_hour:
sys.exit() # sys.exit()
end_time = int(now.timestamp() * 1e3) end_time = int(now.timestamp() * 1e3)
for count, platform in enumerate(get_task_from_redis()): for count, platform in enumerate(get_task_from_redis()):
now = datetime.datetime.now() now = datetime.datetime.now()
...@@ -267,10 +267,10 @@ if __name__ == "__main__": ...@@ -267,10 +267,10 @@ if __name__ == "__main__":
future = executor.submit(start_crawler,processe,name) future = executor.submit(start_crawler,processe,name)
futures.append(future) futures.append(future)
print('Processe %s start' % processe) print('Processe %s start' % processe)
while True: # while True:
now = datetime.datetime.now() # now = datetime.datetime.now()
if now.hour >= exit_hour: # if now.hour >= exit_hour:
for future in futures: # for future in futures:
future.cancel() # future.cancel()
sys.exit() # sys.exit()
# singel_thead("1") # 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