Configurable heartbeat, test that a dead peer doesn't stop pings
This commit is contained in:
+1
-1
@@ -235,7 +235,7 @@ hub = Hub()
|
||||
async def heartbeat():
|
||||
# proxies (cloudflare ~100s) drop idle websockets, keep every socket chatty
|
||||
while True:
|
||||
await asyncio.sleep(25)
|
||||
await asyncio.sleep(config.HEARTBEAT_S)
|
||||
try:
|
||||
conns = [ws for group in hub.screens.values() for ws in group]
|
||||
conns += [ws for group in hub.admins.values() for ws in group]
|
||||
|
||||
@@ -22,6 +22,8 @@ TOKEN_GRACE_MS = int(os.environ.get("TOKEN_GRACE_MS", "2500"))
|
||||
ATTEMPT_SLACK_MS = int(os.environ.get("ATTEMPT_SLACK_MS", "8000"))
|
||||
# once presence is proven, how long the voter has to type an access code
|
||||
CODE_ENTRY_TTL_S = 180
|
||||
# keepalive for websockets, proxies drop idle ones (cloudflare ~100s)
|
||||
HEARTBEAT_S = float(os.environ.get("HEARTBEAT_S", "25"))
|
||||
|
||||
# codes needed to confirm each vote, 0 turns the check off
|
||||
DEFAULT_VOTE_SCANS = 3
|
||||
|
||||
Reference in New Issue
Block a user