beamlit 0.0.23rc16__py3-none-any.whl → 0.0.24rc17__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
beamlit/serve/app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import asyncio
|
1
2
|
import importlib
|
2
3
|
import os
|
3
4
|
import sys
|
@@ -6,11 +7,10 @@ from logging import getLogger
|
|
6
7
|
from uuid import uuid4
|
7
8
|
|
8
9
|
from asgi_correlation_id import CorrelationIdMiddleware
|
10
|
+
from beamlit.common.settings import get_settings, init
|
9
11
|
from fastapi import FastAPI, Request, Response
|
10
12
|
from fastapi.responses import JSONResponse
|
11
13
|
|
12
|
-
from beamlit.common.settings import get_settings, init
|
13
|
-
|
14
14
|
from .middlewares import AccessLogMiddleware, AddProcessTimeHeader
|
15
15
|
|
16
16
|
sys.path.insert(0, os.getcwd())
|
@@ -53,7 +53,10 @@ async def root(request: Request):
|
|
53
53
|
logger = getLogger(__name__)
|
54
54
|
try:
|
55
55
|
body = await request.json()
|
56
|
-
|
56
|
+
if not asyncio.iscoroutinefunction(func):
|
57
|
+
response = func(body)
|
58
|
+
else:
|
59
|
+
response = await func(body)
|
57
60
|
if isinstance(response, Response):
|
58
61
|
return response
|
59
62
|
if type(response) is str:
|
@@ -294,10 +294,10 @@ beamlit/models/websocket_channel.py,sha256=tyNtsVR0cOwd6BK--ehBCH8bIjxtyPhiAkrxY
|
|
294
294
|
beamlit/models/workspace.py,sha256=s7wS6ibswosB0FdUb3ry3BnlLa325axBdYPLI3ipe0Q,3986
|
295
295
|
beamlit/models/workspace_labels.py,sha256=WbnUY6eCTkUNdY7hhhSF-KQCl8fWFfkCf7hzCTiNp4A,1246
|
296
296
|
beamlit/models/workspace_user.py,sha256=70CcifQWYbeWG7TDui4pblTzUe5sVK0AS19vNCzKE8g,3423
|
297
|
-
beamlit/serve/app.py,sha256=
|
297
|
+
beamlit/serve/app.py,sha256=UFIEb8wbvt8_ZGVXmRFimrG6TAod0ysTtn1E1_yByvA,2514
|
298
298
|
beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
|
299
299
|
beamlit/serve/middlewares/accesslog.py,sha256=wM52-hcwtO-_hdM1pnsEJzerzJf1MzEyN5m85BdDccE,609
|
300
300
|
beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
|
301
|
-
beamlit-0.0.
|
302
|
-
beamlit-0.0.
|
303
|
-
beamlit-0.0.
|
301
|
+
beamlit-0.0.24rc17.dist-info/METADATA,sha256=8Rlj6oGJatG92HYskgSXJ4iubImPtr09qkHlDohMnM8,2027
|
302
|
+
beamlit-0.0.24rc17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
303
|
+
beamlit-0.0.24rc17.dist-info/RECORD,,
|
File without changes
|