Skip to content

Commit 0d0ab8e

Browse files
committed
manager: added asyncio main loop to avoid Lock error
1 parent 83b0c6f commit 0d0ab8e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from knot_resolver.manager.main import main
2+
from knot_resolver.utils.compat import asyncio
23

34
if __name__ == "__main__":
4-
main()
5+
asyncio.run(main())

python/knot_resolver/manager/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def parse_args() -> argparse.Namespace:
3535
return parser.parse_args()
3636

3737

38-
def main() -> NoReturn:
38+
async def main() -> NoReturn:
3939
# initial logging is to memory until we read the config
4040
logger_startup()
4141

@@ -48,5 +48,5 @@ def main() -> NoReturn:
4848
else:
4949
config_path = CONFIG_FILE
5050

51-
exit_code = compat.asyncio.run(start_server(config=config_path))
51+
exit_code = await start_server(config=config_path)
5252
sys.exit(exit_code)

0 commit comments

Comments
 (0)