Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

program stuck on "sending alert message" loop until it finally sends the alert preventing it from moving on to different phase #9

Open
1 of 2 tasks
RoguedBear opened this issue Mar 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@RoguedBear
Copy link
Owner

RoguedBear commented Mar 22, 2022

Lines of code creating the problem:

12-hour-server/smart_sleep.py

Lines 1108 to 1119 in a2d2d5e

while True:
try:
alert_onTelegram(
"Hello There!\nToday the internet came back quite early.\nLast sleep time: `{}`".format(
LAST_SLEEP_TIME_byProgram.strftime("%b %d %H:%M:%S")
if LAST_SLEEP_TIME_byProgram != datetime.datetime.min
else LAST_SLEEP_TIME.strftime("%b %d %H:%M:%S")
)
)
break
except Exception:
continue

While this loop is running, the program would continue to spam alert_onTelegram function until it sends a message, preventing it from moving on to a different phase when enough time passes and potentially keeping the laptop awake the entire night

instead it should:

  • use a timeout/sleep instead of spamming that function
  • keep track of current phase, if we move on to midnight break the loop (and possibly store the current message to be sent in the next day's loop)
@RoguedBear RoguedBear added the bug Something isn't working label Mar 22, 2022
@RoguedBear
Copy link
Owner Author

partially fixed in 894158b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant