Skip to content

Commit

Permalink
api-server, asgi.scope instead of scope
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Jul 18, 2024
1 parent 9408632 commit c47724c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/api-server/api_server/fast_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from reactivex.abc import DisposableBase
from starlette.routing import compile_path

from api_server.logging import LoggerAdapter, get_logger
from api_server.logging import LoggerAdapter, default_logger, get_logger
from api_server.models.user import User

from .errors import *
Expand Down Expand Up @@ -244,7 +244,10 @@ def _match_routes(
return None

async def _on_connect(self, sid: str, environ: dict, auth: dict | None = None):
logger = get_logger(HTTPConnection(environ))
if "asgi.scope" in environ:
logger = get_logger(HTTPConnection(environ["asgi.scope"]))
else:
logger = default_logger
user = (
await self._socketio_connect(sid, environ, auth)
if self._socketio_connect
Expand Down

0 comments on commit c47724c

Please sign in to comment.