mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-10-25 00:56:14 +08:00
设置为守护线程
This commit is contained in:
+5
-3
@@ -173,11 +173,13 @@ def bulk_request(urls):
|
|||||||
thread_count = req_thread_count()
|
thread_count = req_thread_count()
|
||||||
bar = get_progress_bar(total)
|
bar = get_progress_bar(total)
|
||||||
|
|
||||||
progress_thread = Thread(target=progress, args=(bar, total, urls_queue))
|
progress_thread = Thread(target=progress, name='ProgressThread',
|
||||||
|
args=(bar, total, urls_queue), daemon=True)
|
||||||
progress_thread.start()
|
progress_thread.start()
|
||||||
|
|
||||||
for _ in range(thread_count):
|
for i in range(thread_count):
|
||||||
request_thread = Thread(target=request, args=(urls_queue, resp_queue, session))
|
request_thread = Thread(target=request, name=f'RequestThread-{i}',
|
||||||
|
args=(urls_queue, resp_queue, session), daemon=True)
|
||||||
request_thread.start()
|
request_thread.start()
|
||||||
|
|
||||||
urls_queue.join()
|
urls_queue.join()
|
||||||
|
|||||||
Reference in New Issue
Block a user