Merge pull request #2495 from minhhoangvn/fix/update-service-name-grpc

Bug fix: gRPC check throws errors when response data size > 50 chars
This commit is contained in:
Louis Lam
2023-01-01 13:57:10 +08:00
committed by GitHub
3 changed files with 28 additions and 18 deletions

View File

@@ -548,7 +548,7 @@ class Monitor extends BeanModel {
log.debug("monitor:", `gRPC response: ${JSON.stringify(response)}`);
let responseData = response.data;
if (responseData.length > 50) {
responseData = response.substring(0, 47) + "...";
responseData = responseData.toString().substring(0, 47) + "...";
}
if (response.code !== 1) {
bean.status = DOWN;