Improve thread handling
This commit is contained in:
parent
e5130da9e5
commit
f916cca064
1 changed files with 2 additions and 2 deletions
|
@ -41,12 +41,12 @@ if __name__ == "__main__":
|
||||||
threads = []
|
threads = []
|
||||||
|
|
||||||
for card in getFile():
|
for card in getFile():
|
||||||
t = threading.Thread(target=getBalance, args=(card["number"], card["ccn"], q, eq))
|
t = threading.Thread(target=getBalance, args=(card["number"], card["ccn"], q, eq), daemon=True)
|
||||||
t.start()
|
t.start()
|
||||||
threads += [t]
|
threads += [t]
|
||||||
|
|
||||||
for t in threads:
|
for t in threads:
|
||||||
t.join()
|
t.join(10)
|
||||||
|
|
||||||
if not eq.empty():
|
if not eq.empty():
|
||||||
exc = eq.get()
|
exc = eq.get()
|
||||||
|
|
Loading…
Reference in a new issue