优化代码

This commit is contained in:
GoEdgeLab
2022-04-13 19:24:23 +08:00
parent d286cb25bc
commit 024035943a
2 changed files with 8 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import (
"github.com/TeaOSLab/EdgeNode/internal/configs"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"strings"
"sync"
)
@@ -45,5 +46,9 @@ func IsConnError(err error) bool {
return errorCode == codes.Unavailable || errorCode == codes.Canceled
}
if strings.Contains(err.Error(), "code = Canceled") {
return true
}
return false
}