Added migration logic
This commit is contained in:
@@ -3,8 +3,10 @@ from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from cpl_core.logging import LoggerABC
|
||||
|
||||
from gismo_core.abc.bot_service_abc import BotServiceABC
|
||||
from gismo_core.service.bot_service import BotService
|
||||
from gismo_data.service.migration_service import MigrationService
|
||||
|
||||
|
||||
class Gismo(ApplicationABC):
|
||||
@@ -14,12 +16,14 @@ class Gismo(ApplicationABC):
|
||||
|
||||
self._bot: BotService = services.get_service(BotServiceABC)
|
||||
self._logger: LoggerABC = services.get_service(LoggerABC)
|
||||
self._migrations: MigrationService = services.get_service(MigrationService)
|
||||
|
||||
async def configure(self):
|
||||
pass
|
||||
|
||||
async def main(self):
|
||||
try:
|
||||
self._migrations.migrate()
|
||||
self._logger.trace(__name__, f'Try to start {BotService}')
|
||||
await self._bot.start_async()
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user