This commit is contained in:
retoor 2025-05-23 07:07:19 +02:00
parent 1c873b7d02
commit 30b7871583

View File

@ -360,11 +360,10 @@ class RPCView(BaseView):
async def get(self):
scheduled = []
async def schedule(uid, seconds, call):
scheduled.append(call)
await asyncio.sleep(seconds)
await self.services.socket.send_to_user(uid, call)
sheduled.remove(call)
scheduled.remove(call)
ws = web.WebSocketResponse()
await ws.prepare(self.request)
@ -378,8 +377,8 @@ class RPCView(BaseView):
await self.services.socket.subscribe(
ws, subscription["channel_uid"], self.request.session.get("uid")
)
if not scheduled and self.request.app.uptime_seconds < 10:
await schedule(self.request.session.get("uid"),1,{"event":"refresh", "data": {
if not scheduled and self.request.app.uptime_seconds < 5:
await schedule(self.request.session.get("uid"),0,{"event":"refresh", "data": {
"message": "Finishing deployment"}
}
)