Skip to content

Commit

Permalink
feat: set fail_count to 0 after auto-disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Oct 16, 2023
1 parent 1582349 commit 70b0939
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions free_one_api/impls/watchdog/tasks/heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ async def process(ch: channel.Channel):
if fail_count >= self.cfg["fail_limit"]:
try:
await self.channel.disable_channel(ch.id)
ch.fail_count = 0
logging.info(f"Disabled channel {ch.id} due to heartbeat failed {fail_count} times")
except Exception:
logging.warn(f"Failed to disable channel {ch.id}, traceback: {traceback.format_exc()}")
Expand Down

0 comments on commit 70b0939

Please sign in to comment.