Skip to content

Commit 618533a

Browse files
committed
Attempting to add a sleep statement for the ip binding as it sometimes fails to bind
1 parent a9081e4 commit 618533a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import socket
88
import sys
9+
import time
910
import pidfile
1011

1112
# Desktop Credentials
@@ -72,6 +73,8 @@
7273

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

0 commit comments

Comments
 (0)