why
parent
5db7b20e9f
commit
d3927f5bca
Binary file not shown.
Binary file not shown.
|
@ -355,12 +355,12 @@ async def main():
|
|||
raise RuntimeError("Set the DISCORD_TOKEN environment variable or add it to a .env file.")
|
||||
|
||||
try:
|
||||
web_task = server.app.run_task(host="0.0.0.0", port=8000, debug=False)
|
||||
discord_task = start_discord()
|
||||
web_task = asyncio.create_task(server.app.run_task(host="0.0.0.0", port=8000, debug=False))
|
||||
discord_task = asyncio.create_task(start_discord())
|
||||
|
||||
await asyncio.gather(web_task, discord_task)
|
||||
await asyncio.wait({web_task, discord_task}, return_when=asyncio.FIRST_COMPLETED)
|
||||
finally:
|
||||
await PlaywrightPool.stop()
|
||||
# await PlaywrightPool.stop()
|
||||
server.article_repository.close()
|
||||
|
||||
if not bot.is_closed():
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from quart import Quart, request, jsonify, abort
|
||||
from quart import Quart, request, jsonify, abort, send_from_directory
|
||||
from pathlib import Path
|
||||
import logging
|
||||
|
||||
|
@ -12,6 +12,10 @@ article_repository = ArticleRepository()
|
|||
|
||||
LOGGER = logging.getLogger("server")
|
||||
|
||||
@app.route("/")
|
||||
async def index():
|
||||
return await send_from_directory("static", "index.html")
|
||||
|
||||
@app.route("/health")
|
||||
async def health():
|
||||
return {"status": "ok"}
|
||||
|
|
Loading…
Reference in New Issue