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).
このコミットが含まれているのは:
コミット
46f9b0ec08
|
@ -2,9 +2,6 @@
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from math import inf
|
|
||||||
|
|
||||||
from quart import current_app, websocket
|
from quart import current_app, websocket
|
||||||
|
|
||||||
from anonstream.user import see, reading
|
from anonstream.user import see, reading
|
||||||
|
@ -15,7 +12,7 @@ from anonstream.routes.wrappers import with_user_from
|
||||||
@with_user_from(websocket)
|
@with_user_from(websocket)
|
||||||
async def live(timestamp, user):
|
async def live(timestamp, user):
|
||||||
queue = asyncio.Queue()
|
queue = asyncio.Queue()
|
||||||
user['websockets'][queue] = -inf
|
user['websockets'][queue] = timestamp
|
||||||
reading(user, timestamp=timestamp)
|
reading(user, timestamp=timestamp)
|
||||||
|
|
||||||
producer = websocket_outbound(queue, user)
|
producer = websocket_outbound(queue, user)
|
||||||
|
|
読み込み中…
新しいイシューから参照