MCPcopy Create free account
hub / github.com/Drakkar-Software/OctoBot / create

Method create

octobot/initializer.py:31–56  ·  view source on GitHub ↗
(self, init_bot_storage)

Source from the content-addressed store, hash-verified

29 self.octobot = octobot
30
31 async def create(self, init_bot_storage):
32 # initialize tentacle configuration
33 startup_config = self.octobot.get_startup_config(constants.CONFIG_KEY, dict_only=False)
34 self.octobot.tentacles_setup_config = startup_config.get_active_tentacles_setup_config()
35
36 if init_bot_storage:
37 try:
38 # init bot storage
39 await databases.init_bot_storage(
40 self.octobot.bot_id,
41 trading_api.get_run_databases_identifier(
42 self.octobot.config,
43 self.octobot.tentacles_setup_config
44 ),
45 True
46 )
47 except commons_errors.ConfigTradingError as err:
48 # already logged as error, don't display it twice
49 logging.get_logger(self.__class__.__name__).warning(f"Error when initializing bot storage: {err}")
50 except Exception as err:
51 logging.get_logger(self.__class__.__name__).exception(
52 err, True, f"Error when initializing bot storage: {err}"
53 )
54
55 # create OctoBot channel
56 await self.octobot.global_consumer.initialize()

Callers

nothing calls this directly

Calls 7

warningMethod · 0.80
get_startup_configMethod · 0.45
get_loggerMethod · 0.45
exceptionMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected