Skip to content

Commit

Permalink
Updating Static Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottGibb committed Aug 5, 2024
1 parent b30dd73 commit 8b320bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Static Analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- name: Install pylint
run: |
pip install pylint
pip install -r requierements.txt
- name: Checkout code
uses: actions/checkout@v2
- name: Run pylint
Expand Down
11 changes: 5 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import socket
import sys
import time
import pidfile

# Desktop Credentials
Expand All @@ -32,9 +31,9 @@
logger.error('Sleep on LAN Script already running, Aborting!')
sys.exit(-1)

error_count = 0
ERROR_COUNT = 0
while True:
if error_count > MAX_ERRORS:
if ERROR_COUNT > MAX_ERRORS:
logger.error(f'Sleep on LAN Script reached max error count {MAX_ERRORS}')
logger.error("System Exiting")
sys.exit(-2)
Expand All @@ -47,7 +46,7 @@
sock.bind((HOST, PORT))
logger.info(f"Binded on port {PORT}")
logger.info(f"Attempting to listen on port {PORT}")
error_count = 0
ERROR_COUNT = 0
sock.listen()
logger.info("Listening on Port 60000")
conn, addr = sock.accept()
Expand All @@ -74,5 +73,5 @@
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.info(f"Attempting to restart loop! Error Number: {error_count}")
error_count = error_count+1
logger.info(f"Attempting to restart loop! Error Number: {ERROR_COUNT}")
ERROR_COUNT = ERROR_COUNT+1

0 comments on commit 8b320bb

Please sign in to comment.