File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ def serve(
8282 If insecure is true requests will be served insecurely, even if credentials
8383 are supplied.
8484 """
85+ # Define the loop before the server so everything uses the same loop.
86+ loop = asyncio .get_event_loop ()
87+
8588 server = grpc .aio .server ()
8689
8790 grpcv1beta1 .add_FunctionRunnerServiceServicer_to_server (function , server )
@@ -104,7 +107,6 @@ async def start():
104107 await server .start ()
105108 await server .wait_for_termination ()
106109
107- loop = asyncio .get_event_loop ()
108110 try :
109111 loop .run_until_complete (start ())
110112 finally :
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ packages = ["crossplane"]
7373[tool .ruff ]
7474target-version = " py311"
7575exclude = [" crossplane/function/proto/*" ]
76- select = [
76+ lint. select = [
7777 " A" ,
7878 " ARG" ,
7979 " ASYNC" ,
@@ -103,12 +103,12 @@ select = [
103103 " W" ,
104104 " YTT" ,
105105]
106- ignore = [" ISC001" ] # Ruff warns this is incompatible with ruff format.
106+ lint. ignore = [" ISC001" ] # Ruff warns this is incompatible with ruff format.
107107
108108[tool .ruff .lint .per-file-ignores ]
109109"tests/*" = [" D" ] # Don't require docstrings for tests.
110110
111- [tool .ruff .isort ]
111+ [tool .ruff .lint . isort ]
112112known-first-party = [" crossplane" ]
113113
114114[tool .ruff .lint .pydocstyle ]
You can’t perform that action at this time.
0 commit comments