Skip to content

Commit

Permalink
On channel watch error, mark the channel offline and try another
Browse files Browse the repository at this point in the history
  • Loading branch information
imranh2 committed Oct 28, 2024
1 parent b792423 commit cf65886
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,6 @@ async def send_watch(self) -> bool:
async with self._twitch.request("HEAD", stream_chunk_url) as head_response:
return head_response.status == 200
except aiohttp.InvalidURL as exc:
# Temporarily log the entire response into the output
raise MinerException(available_chunks) from exc
return False
## Temporarily log the entire response into the output
#raise MinerException(available_chunks) from exc
4 changes: 4 additions & 0 deletions twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,10 @@ async def _watch_loop(self) -> NoReturn:
succeeded: bool = await channel.send_watch()
if not succeeded:
logger.log(CALL, f"Watch requested failed for channel: {channel.name}")
logger.info(f"Failed to watch {channel.name} so marking as offline & removing...")
channel.set_offline()
channel.remove()
continue
elif not self.gui.progress.is_counting():
# If the previous update was more than 60s ago, and the progress tracker
# isn't counting down anymore, that means Twitch has temporarily
Expand Down

0 comments on commit cf65886

Please sign in to comment.