Added feature-flags #48
This commit is contained in:
		| @@ -5,6 +5,8 @@ from cpl_core.configuration import ConfigurationABC | ||||
| from cpl_core.dependency_injection import ServiceProviderABC | ||||
| from cpl_core.logging import LoggerABC | ||||
|  | ||||
| from bot_core.configuration.feature_flags_settings import FeatureFlagsSettings | ||||
|  | ||||
|  | ||||
| class BootLogExtension(ApplicationExtensionABC): | ||||
|  | ||||
| @@ -12,6 +14,9 @@ class BootLogExtension(ApplicationExtensionABC): | ||||
|         pass | ||||
|  | ||||
|     async def run(self, config: ConfigurationABC, services: ServiceProviderABC): | ||||
|         feature_flags: FeatureFlagsSettings = config.get_configuration(FeatureFlagsSettings) | ||||
|         if not feature_flags.boot_log_module: | ||||
|             return | ||||
|         logger: LoggerABC = services.get_service(LoggerABC) | ||||
|         logger.debug(__name__, 'BootLog extension started') | ||||
|         config.add_configuration('Bot_StartTime', str(datetime.now())) | ||||
|   | ||||
| @@ -5,6 +5,7 @@ from cpl_core.configuration import ConfigurationABC | ||||
| from cpl_core.dependency_injection import ServiceProviderABC | ||||
| from cpl_core.logging import LoggerABC | ||||
|  | ||||
| from bot_core.configuration.feature_flags_settings import FeatureFlagsSettings | ||||
| from bot_data.service.migration_service import MigrationService | ||||
|  | ||||
|  | ||||
| @@ -14,6 +15,9 @@ class DatabaseExtension(ApplicationExtensionABC): | ||||
|         pass | ||||
|  | ||||
|     async def run(self, config: ConfigurationABC, services: ServiceProviderABC): | ||||
|         feature_flags: FeatureFlagsSettings = config.get_configuration(FeatureFlagsSettings) | ||||
|         if not feature_flags.database_module: | ||||
|             return | ||||
|         logger: LoggerABC = services.get_service(LoggerABC) | ||||
|         logger.debug(__name__, 'Database extension started') | ||||
|         config.add_configuration('Database_StartTime', str(datetime.now())) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user