Reset globals before running speedtest
							parent
							
								
									d2e5955d1d
								
							
						
					
					
						commit
						d8b5235502
					
				| 
						 | 
				
			
			@ -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()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue