| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -248,19 +248,18 @@ def uploader_fn(exit_event): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  uploader = Uploader(dongle_id, access_token, ROOT) | 
					 | 
					 | 
					 | 
					  uploader = Uploader(dongle_id, access_token, ROOT) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  backoff = 0.1 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  while True: | 
					 | 
					 | 
					 | 
					  while True: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    upload_video = (params.get("IsUploadVideoOverCellularEnabled") != "0") or is_on_wifi() | 
					 | 
					 | 
					 | 
					    upload_video = (params.get("IsUploadVideoOverCellularEnabled") != "0") or is_on_wifi() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    backoff = 0.1 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    while True: | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if exit_event.is_set(): | 
					 | 
					 | 
					 | 
					    if exit_event.is_set(): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return | 
					 | 
					 | 
					 | 
					      return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    d = uploader.next_file_to_upload(upload_video) | 
					 | 
					 | 
					 | 
					    d = uploader.next_file_to_upload(upload_video) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if d is None: | 
					 | 
					 | 
					 | 
					    if d is None: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        break | 
					 | 
					 | 
					 | 
					      time.sleep(5) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      continue | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    key, fn, _ = d | 
					 | 
					 | 
					 | 
					    key, fn, _ = d | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -274,8 +273,6 @@ def uploader_fn(exit_event): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      backoff = min(backoff*2, 120) | 
					 | 
					 | 
					 | 
					      backoff = min(backoff*2, 120) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    cloudlog.info("upload done, success=%r", success) | 
					 | 
					 | 
					 | 
					    cloudlog.info("upload done, success=%r", success) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    time.sleep(5) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def main(gctx=None): | 
					 | 
					 | 
					 | 
					def main(gctx=None): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  uploader_fn(threading.Event()) | 
					 | 
					 | 
					 | 
					  uploader_fn(threading.Event()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |