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:
parent
f70b18040a
commit
af51c317e2
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue