Randomized skeep.
This commit is contained in:
parent
1babfa0d64
commit
cc6a9ef9d3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user