bug: trying to track down lock-up bug

For some reason the script seems to be occasionally locking up,
and then because the systemd service state is stuck in "starting"
it never finishes which means the timer never gets reset.

Adding some debug statements to try and figure out the cause.
Also changed logging to DEBUG level. I'd much rather fix the
bug but a timeout would also solve the issue.
This commit is contained in:
A.M. Rowsell 2025-04-19 12:45:07 -04:00
commit af51c317e2
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9

View file

@ -104,7 +104,7 @@ def setupPaths():
logging.basicConfig(
filename=str(log_dir + log_file_path),
encoding="utf-8",
level=logging.INFO,
level=logging.DEBUG,
datefmt="%m/%d/%Y %H:%M:%S",
format="%(asctime)s: %(levelname)s: %(message)s",
)
@ -200,6 +200,7 @@ def main():
}
webhook_string = json.dumps(webhook)
logger.debug("About to run POST for %s", hook["name"])
r = requests.post(hook["webhook"], data=webhook_string, headers=custom_header)
if r.status_code not in success_codes:
logger.error(
@ -211,6 +212,7 @@ def main():
# End of feed loop
# Dump updated config back to json file
logger.debug("Dumping config back to %s", str(config_file_path))
app_config["lastupdate"] = now
with open(config_file_path, "w") as config_file:
json.dump(app_config, config_file, indent=4)