File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ def serve(
82
82
If insecure is true requests will be served insecurely, even if credentials
83
83
are supplied.
84
84
"""
85
+ # Define the loop before the server so everything uses the same loop.
86
+ loop = asyncio .get_event_loop ()
87
+
85
88
server = grpc .aio .server ()
86
89
87
90
grpcv1beta1 .add_FunctionRunnerServiceServicer_to_server (function , server )
@@ -104,7 +107,6 @@ async def start():
104
107
await server .start ()
105
108
await server .wait_for_termination ()
106
109
107
- loop = asyncio .get_event_loop ()
108
110
try :
109
111
loop .run_until_complete (start ())
110
112
finally :
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ packages = ["crossplane"]
73
73
[tool .ruff ]
74
74
target-version = " py311"
75
75
exclude = [" crossplane/function/proto/*" ]
76
- select = [
76
+ lint. select = [
77
77
" A" ,
78
78
" ARG" ,
79
79
" ASYNC" ,
@@ -103,12 +103,12 @@ select = [
103
103
" W" ,
104
104
" YTT" ,
105
105
]
106
- ignore = [" ISC001" ] # Ruff warns this is incompatible with ruff format.
106
+ lint. ignore = [" ISC001" ] # Ruff warns this is incompatible with ruff format.
107
107
108
108
[tool .ruff .lint .per-file-ignores ]
109
109
"tests/*" = [" D" ] # Don't require docstrings for tests.
110
110
111
- [tool .ruff .isort ]
111
+ [tool .ruff .lint . isort ]
112
112
known-first-party = [" crossplane" ]
113
113
114
114
[tool .ruff .lint .pydocstyle ]
You can’t perform that action at this time.
0 commit comments