Randomized skeep.
This commit is contained in:
parent
1babfa0d64
commit
cc6a9ef9d3
@ -11,7 +11,7 @@ import asyncio
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import traceback
|
import traceback
|
||||||
|
import random
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
from snek.system.model import now
|
from snek.system.model import now
|
||||||
@ -636,6 +636,7 @@ class RPCView(BaseView):
|
|||||||
async for msg in ws:
|
async for msg in ws:
|
||||||
if msg.type == web.WSMsgType.TEXT:
|
if msg.type == web.WSMsgType.TEXT:
|
||||||
try:
|
try:
|
||||||
|
await asyncio.sleep(random.uniform(0.1,0.4))
|
||||||
await rpc(msg.json())
|
await rpc(msg.json())
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print("Deleting socket", ex, flush=True)
|
print("Deleting socket", ex, flush=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user