Experimental crumb loading

This commit is contained in:
Ben 2019-04-11 01:03:08 +01:00
parent 30f1f1fb7f
commit 5b8b574198

View File

@ -21,6 +21,8 @@ from aiocache import SimpleMemoryCache
from watchdog.observers import Observer
from Houdini.Data import db
from Houdini.Data.Stamp import Stamp
from Houdini.Data.Room import Room
try:
import uvloop
@ -55,6 +57,10 @@ class HoudiniFactory:
self.penguins_by_username = {}
self.xt_listeners, self.xml_listeners = {}, {}
self.plugins = {}
self.stamps = []
self.rooms = []
async def start(self):
self.config = config
@ -130,6 +136,11 @@ class HoudiniFactory:
self.load_handler_modules("Houdini.Handlers.Login.Login")
self.logger.info('Login server started')
self.stamps = await db.all(Stamp.query)
self.rooms = await Room.query.gino.all()
self.logger.info('Loaded %d stamps', len(self.stamps))
self.logger.info('Loaded %d rooms', len(self.rooms))
handlers_path = './Houdini{}Handlers'.format(os.path.sep)
plugins_path = './Houdini{}Plugins'.format(os.path.sep)
self.configure_obvservers([handlers_path, HandlerFileEventHandler])