diff --git a/pioreactor/cli/pio.py b/pioreactor/cli/pio.py index 7c512ea4..d6c81cc2 100644 --- a/pioreactor/cli/pio.py +++ b/pioreactor/cli/pio.py @@ -140,7 +140,12 @@ def log(message: str, level: str, name: str, local_only: bool): to_mqtt=not local_only, ) getattr(logger, level)(message) - sleep(0.5) # wait to make sure msg gets to mqtt + + # flush and close handlers + for handler in logger.handlers: + handler.flush() + handler.close() + except Exception: # don't let a logging error bring down a script... pass diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 39e39b75..bb0fe39b 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,4 +1,4 @@ -click==8.1.3 +click==8.1.6 paho-mqtt==1.6.1 psutil==5.9.5 sh==1.14.2 diff --git a/setup.py b/setup.py index 05a42f12..06b6c24f 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ CORE_REQUIREMENTS = [ - "click==8.1.3", + "click==8.1.6", "paho-mqtt==1.6.1", "psutil==5.9.5", "sh==1.14.3",