[Support] @midwayjs/typegoose组件的健康检查报错 #4056
-
Describe the problem(描述问题)健康检查代码 import { Controller, Get, Inject, MidwayHealthService } from '@midwayjs/core';
@Controller('/_health')
export class HealthController {
@Inject()
healthService: MidwayHealthService;
@Get('', { summary: '健康检查' })
async status() {
return this.healthService.getStatus();
}
} 输出结果 {
"status": false,
"namespace": "mongoose",
"reason": "Cannot read properties of undefined (reading 'default')",
"results": [
{
"namespace": "redis",
"status": true,
"reason": ""
},
{
"status": false,
"namespace": "mongoose",
"reason": "Cannot read properties of undefined (reading 'default')"
}
]
} Midway Versions(Midway 版本)
✓ @midwayjs/faas-typings(not installed)
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
报错定位到 midway/packages/core/src/common/dataSourceManager.ts Lines 229 to 231 in 5672afc 这里的 |
Beta Was this translation helpful? Give feedback.
-
而且mongoose模块的健康检查逻辑有点奇怪: midway/packages/mongoose/src/configuration.ts Lines 47 to 68 in 5672afc 为什么已经建立连接的数据源必须是低优先级才能认为是ready呢? |
Beta Was this translation helpful? Give feedback.
-
fix in #4061 |
Beta Was this translation helpful? Give feedback.
fix in #4061