INNER CODE UNIT · Python
wait_time
lebinh/ngxtop · ngxtop/ngxtop.py:218
wait_time = 0.1 * (2 ** attempt)
logging.warning(f"Failed to open {file_path} (attempt {attempt + 1}/{max_retries}): {e}. Retrying in {wait_time}s...")
time.sleep(wait_time)
else:
logging.error(f"Failed to open {file_path} after {max_retries} attempts: {e}")
return None, None, 0
def _sighup_handler(signum, frame):
"""Signal handler for SIGHUP - marks rotation as requested."""
global _rotation_requested
_rotation_requested = True
logging.info("SIGHUP received - will reopen log file on next check")
def _check_rotation_signal():
"""Check if log rotation was requested via signal."""