Skip to content

Commit

Permalink
feat: make heartbeat out-of-order (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Oct 13, 2023
1 parent 71ed3ee commit 7d19f9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions free_one_api/impls/watchdog/tasks/heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, chan: chanmgr.AbsChannelManager, cfg: dict):
self.channel = chan
self.cfg = cfg

self.delay = 10
self.delay = 5
self.interval = cfg['interval']

async def trigger(self):
Expand All @@ -30,7 +30,7 @@ async def trigger(self):
for chan in self.channel.channels:
if chan.enabled:
async def process(ch: channel.Channel):
random_delay = random.randint(0, 10)
random_delay = random.randint(0, 30)
await asyncio.sleep(random_delay)

fail_count = await ch.heartbeat(timeout=self.cfg["timeout"])
Expand Down

0 comments on commit 7d19f9e

Please sign in to comment.