Reset websocket aliveness timer on first connecting

This should eliminate the possibilty of the websocket-closing background
task closing a newly opened websocket that hasn't yet ponged our ping
(if we have even sent a ping yet).
このコミットが含まれているのは:
n9k 2022-06-19 09:24:28 +00:00
コミット 46f9b0ec08
1個のファイルの変更1行の追加4行の削除

ファイルの表示

@ -2,9 +2,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import asyncio
from math import inf
from quart import current_app, websocket
from anonstream.user import see, reading
@ -15,7 +12,7 @@ from anonstream.routes.wrappers import with_user_from
@with_user_from(websocket)
async def live(timestamp, user):
queue = asyncio.Queue()
user['websockets'][queue] = -inf
user['websockets'][queue] = timestamp
reading(user, timestamp=timestamp)
producer = websocket_outbound(queue, user)