Closed tomac4t closed 11 months ago
Good find. I thought that a negative duration would cause time.sleep
to return immediately, but it looks like it throws an exception instead.
if
/else
, use something like max(reset_seconds, 5)
.BASE_URL
) instead of the literal 5
.print
that shows when the program will resume. Make the displayed timestamp match what was computed (i.e., store datetime.datetime.utcnow()
in a variable before computing reset_seconds
, then add reset_seconds
to it when the timestamp is printed).Thanks, that's a pretty nice idea.
Local time isn't the same as server time, which may cause sleep negative seconds. When it happens, consider retrying after 5 seconds.