MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / reload

Method reload

astrbot/core/platform/manager.py:256–265  ·  view source on GitHub ↗
(self, platform_config: dict)

Source from the content-addressed store, hash-verified

254 platform.record_error(error_msg, tb_str)
255
256 async def reload(self, platform_config: dict) -> None:
257 await self.terminate_platform(platform_config["id"])
258 if platform_config["enable"]:
259 await self.load_platform(platform_config)
260
261 # 和配置文件保持同步
262 config_ids = [provider["id"] for provider in self.platforms_config]
263 for key in list(self._inst_map.keys()):
264 if key not in config_ids:
265 await self.terminate_platform(key)
266
267 async def terminate_platform(self, platform_id: str) -> None:
268 if platform_id in self._inst_map:

Callers

nothing calls this directly

Calls 4

terminate_platformMethod · 0.95
load_platformMethod · 0.95
listFunction · 0.50
keysMethod · 0.45

Tested by

no test coverage detected