Reset globals before running speedtest
This commit is contained in:
@@ -126,6 +126,20 @@ downloading = True # True for download, False for upload
|
||||
threads = None
|
||||
servers = []
|
||||
|
||||
def reset_globals():
|
||||
global wan_upload
|
||||
global wan_download
|
||||
global results_dict
|
||||
global test_started
|
||||
global speedtest_failed
|
||||
global downloading
|
||||
|
||||
wan_upload = None
|
||||
wan_download = None
|
||||
results_dict = None
|
||||
test_started = False
|
||||
speedtest_failed = False
|
||||
downloading = True
|
||||
|
||||
def threaded_speedtest():
|
||||
global test_started
|
||||
@@ -197,6 +211,7 @@ def test_speed():
|
||||
global wan_download
|
||||
tries = 2
|
||||
for i in range(tries):
|
||||
reset_globals()
|
||||
sws = Thread(target=threaded_wan_speed)
|
||||
st = Thread(target=threaded_speedtest)
|
||||
st.start()
|
||||
|
||||
Reference in New Issue
Block a user