Implement a backoff strategy for stream status queries to offline instances. #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the bot queries stream status every minute without any variation. This routine does not account for situations where an instance goes offline for an extended period of time. A backoff strategy should be implemented which gradually increases the query interval when an instance is consistently detected as offline.
The maximum query interval needs to be selected carefully. Some streamers only run their instances during active streaming sessions and intentionally take it offline after. The maximum query interval needs to balance reducing unnecessary network traffic and ensuring instances with regular long downtime aren't missed. A value of 15 minutes may be sufficient.
Finally within this topic, it may be worth properly handling code 429 HTTP responses. Owncast does not implement rate limiting on its own and I have not seen this code in the wild, but instances can always be hosted behind reverse proxies which enforce their own policies.