From c47afa29428e085b3ed2613aa3819b40ea4a3927 Mon Sep 17 00:00:00 2001 From: +++ Date: Sun, 22 Nov 2020 22:42:24 +0100 Subject: [PATCH] socket shutdown in exception --- source/server/apistatusd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/server/apistatusd.py b/source/server/apistatusd.py index 04ad48c..eff1010 100755 --- a/source/server/apistatusd.py +++ b/source/server/apistatusd.py @@ -296,7 +296,10 @@ def main(): finally: if mySocket: logging.info('Shutdown socket') - mySocket.shutdown(socket.SHUT_RDWR) + try: + mySocket.shutdown(socket.SHUT_RDWR) + except Exception as e: + logging.error(f'Error while shutdown socket: {e}') return 0