Begin implementing RTS
This commit is contained in:
13
monolith.py
13
monolith.py
@@ -1,8 +1,10 @@
|
||||
import asyncio
|
||||
from os import getenv
|
||||
from time import sleep
|
||||
|
||||
import uvloop
|
||||
|
||||
import db
|
||||
import util
|
||||
from sources.ch4 import Chan4
|
||||
from sources.dis import DiscordClient
|
||||
@@ -34,6 +36,17 @@ async def main(loop):
|
||||
loop.create_task(chan.run())
|
||||
|
||||
|
||||
created = False
|
||||
while not created:
|
||||
try:
|
||||
db.create_index(db.api_client)
|
||||
created = True
|
||||
except Exception as e:
|
||||
print(f"Error creating index: {e}")
|
||||
sleep(1) # Block the thread, just wait for the DB
|
||||
db.update_schema()
|
||||
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.create_task(main(loop))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user