* 获取健康状态
()
| 311 | * 获取健康状态 |
| 312 | */ |
| 313 | public async getHealthStatus(): Promise<{ |
| 314 | healthy: boolean; |
| 315 | components: { [id: string]: { healthy: boolean; error?: string } }; |
| 316 | }> { |
| 317 | const components: { [id: string]: { healthy: boolean; error?: string } } = {}; |
| 318 | let overallHealthy = true; |
| 319 | |
| 320 | for (const [id] of this.components) { |
| 321 | try { |
| 322 | // 这里可以添加组件健康检查逻辑 |
| 323 | // 目前简单检查组件是否存在 |
| 324 | components[id] = { healthy: true }; |
| 325 | } catch (error) { |
| 326 | components[id] = { healthy: false, error: (error as Error).message }; |
| 327 | overallHealthy = false; |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | return { |
| 332 | healthy: overallHealthy && this.isInitialized && !this.isDestroyed, |
| 333 | components, |
| 334 | }; |
| 335 | } |
| 336 | |
| 337 | /** |
| 338 | * 等待组件初始化完成 |
no outgoing calls
no test coverage detected