设置线程为守护线程 随主线程结束而结束

This commit is contained in:
Jing Ling
2020-08-26 23:26:25 +08:00
parent eefa1ecd5b
commit 6062eb22dc
2 changed files with 5 additions and 5 deletions
+2 -3
View File
@@ -49,9 +49,8 @@ class Collect(object):
# Create subdomain collection threads
for collect_func in self.collect_funcs:
func_obj, func_name = collect_func
thread = threading.Thread(target=func_obj,
name=func_name,
args=(self.domain,))
thread = threading.Thread(target=func_obj, name=func_name,
args=(self.domain,), daemon=True)
threads.append(thread)
# Start all threads
for thread in threads: