Rate limit handling seems to be broken: it starts an one-shot timer with callback that reschedules the timer each second and prints/updates messages. Simultaneously it schedules a deferred by 1 second function that cancels the timer and resumes the stream. This results in the timer executing at most once, and stream resume happening way too early. Fix this by switching to use repeating timer with first instance executing immediately. All message handling is moved into the timer callback. Once countdown is complete the same callback will stop and destroy the timer and resume the stream.
40 KiB
40 KiB