Fix control socket & event socket (?)

For some reason this commit seems to make the control and event sockets
work where previously they would sometimes (but ONLY sometimes) refuse
to connect.
このコミットが含まれているのは:
n9k 2022-07-24 05:40:43 +00:00
コミット 2fe67815c6
1個のファイルの変更5行の追加4行の削除

ファイルの表示

@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2022 n9k <https://git.076.ne.jp/ninya9k>
# SPDX-License-Identifier: AGPL-3.0-or-later
import asyncio
import json
from collections import OrderedDict
@ -76,6 +77,10 @@ def create_app(toml_config):
@app.before_serving
async def startup():
# Create routes and background tasks
import anonstream.routes
import anonstream.tasks
# Start control server
if app.config['SOCKET_CONTROL_ENABLED']:
from anonstream.control.server import start_control_server_at
@ -94,8 +99,4 @@ def create_app(toml_config):
)
app.add_background_task(start_event_server)
# Create routes and background tasks
import anonstream.routes
import anonstream.tasks
return app