Randomized skeep.

This commit is contained in:
retoor 2025-08-01 01:57:18 +02:00
parent 1babfa0d64
commit cc6a9ef9d3

View File

@ -11,7 +11,7 @@ import asyncio
import json
import logging
import traceback
import random
from aiohttp import web
from snek.system.model import now
@ -636,6 +636,7 @@ class RPCView(BaseView):
async for msg in ws:
if msg.type == web.WSMsgType.TEXT:
try:
await asyncio.sleep(random.uniform(0.1,0.4))
await rpc(msg.json())
except Exception as ex:
print("Deleting socket", ex, flush=True)