Skip to content

Commit

Permalink
Attempting to add a sleep statement for the ip binding as it sometime…
Browse files Browse the repository at this point in the history
…s fails to bind
  • Loading branch information
ScottGibb committed Aug 31, 2024
1 parent a9081e4 commit 618533a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import socket
import sys
import time
import pidfile

# Desktop Credentials
Expand Down Expand Up @@ -72,6 +73,8 @@

except Exception as e:
logger.error(e)
logger.warning("Python code has reached end of script, the code will no logner talk to Node-Red")
logger.warning("Python code has reached end of script, "
"the code will no longer talk to Node-Red")
logger.info(f"Attempting to restart loop! Error Number: {ERROR_COUNT}")
time.sleep(5) # Sleep for 5 seconds before restarting loop, the ip address might not exist yet
ERROR_COUNT = ERROR_COUNT+1

0 comments on commit 618533a

Please sign in to comment.