Skip to content

Commit

Permalink
Don't do the lifespan during request time
Browse files Browse the repository at this point in the history
  • Loading branch information
buremba committed Oct 12, 2024
1 parent c70b17f commit 85b8578
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion universql/protocol/lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from universql.protocol.snowflake import app as snowflake_app

snowflake = Mangum(snowflake_app)
snowflake = Mangum(snowflake_app, lifespan="off")
4 changes: 3 additions & 1 deletion universql/protocol/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
@snowflake_server_opts
def test(**kwargs):
value[0] = kwargs


with click.Context(snowflake) as ctx:
ctx.params = os.environ
ctx.invoke(test)
Expand All @@ -57,7 +59,7 @@ async def add_process_time_header(request: Request, call_next):
start_time = time.perf_counter()
response = await call_next(request)
# if request.url.path in ["/queries/v1/query-request"]:
print(f"Time took to process {request.url.path} is {time.perf_counter() - start_time} sec")
# print(f"Time took to process {request.url.path} is {time.perf_counter() - start_time} sec")
return response


Expand Down

0 comments on commit 85b8578

Please sign in to comment.