Merge pull request #62 from bobh66/loop
Fix different loop errors on python 3.12
This commit is contained in:
commit
d1c067e388
|
@ -82,6 +82,9 @@ def serve(
|
|||
If insecure is true requests will be served insecurely, even if credentials
|
||||
are supplied.
|
||||
"""
|
||||
# Define the loop before the server so everything uses the same loop.
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
server = grpc.aio.server()
|
||||
|
||||
grpcv1beta1.add_FunctionRunnerServiceServicer_to_server(function, server)
|
||||
|
@ -104,7 +107,6 @@ def serve(
|
|||
await server.start()
|
||||
await server.wait_for_termination()
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
try:
|
||||
loop.run_until_complete(start())
|
||||
finally:
|
||||
|
|
|
@ -73,7 +73,7 @@ packages = ["crossplane"]
|
|||
[tool.ruff]
|
||||
target-version = "py311"
|
||||
exclude = ["crossplane/function/proto/*"]
|
||||
select = [
|
||||
lint.select = [
|
||||
"A",
|
||||
"ARG",
|
||||
"ASYNC",
|
||||
|
@ -103,12 +103,12 @@ select = [
|
|||
"W",
|
||||
"YTT",
|
||||
]
|
||||
ignore = ["ISC001"] # Ruff warns this is incompatible with ruff format.
|
||||
lint.ignore = ["ISC001"] # Ruff warns this is incompatible with ruff format.
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/*" = ["D"] # Don't require docstrings for tests.
|
||||
|
||||
[tool.ruff.isort]
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = ["crossplane"]
|
||||
|
||||
[tool.ruff.lint.pydocstyle]
|
||||
|
|
Loading…
Reference in New Issue