zephyr_mirror: Limit logging of errors when checking restart stamps.
(imported from commit 194b30d757a5f20d6d20bc8aed9154c6aece9837)
This commit is contained in:
		
							parent
							
								
									8f17166ec6
								
							
						
					
					
						commit
						5af166e063
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -258,6 +258,7 @@ def maybe_restart_mirroring_script():
 | 
			
		|||
                time.sleep(1)
 | 
			
		||||
 | 
			
		||||
def process_loop(log):
 | 
			
		||||
    restart_check_count = 0
 | 
			
		||||
    sleep_count = 0
 | 
			
		||||
    sleep_time = 0.1
 | 
			
		||||
    while True:
 | 
			
		||||
| 
						 | 
				
			
			@ -276,8 +277,13 @@ def process_loop(log):
 | 
			
		|||
 | 
			
		||||
        try:
 | 
			
		||||
            maybe_restart_mirroring_script()
 | 
			
		||||
            if restart_check_count > 0:
 | 
			
		||||
                logging.info("Stopped getting errors checking whether restart is required.")
 | 
			
		||||
                restart_check_count = 0
 | 
			
		||||
        except Exception:
 | 
			
		||||
            logger.exception("Error checking whether restart is required:")
 | 
			
		||||
            if restart_check_count < 5:
 | 
			
		||||
                logger.exception("Error checking whether restart is required:")
 | 
			
		||||
                restart_check_count += 1
 | 
			
		||||
 | 
			
		||||
        time.sleep(sleep_time)
 | 
			
		||||
        sleep_count += sleep_time
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue