diff --git a/internal/api/route.go b/internal/api/route.go index 2ba4e66fa..a949acb75 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -2,6 +2,7 @@ package api import ( "context" + "time" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" @@ -17,7 +18,7 @@ import ( ) func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.UniversalClient) *gin.Engine { - discov.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials())) // 默认RPC中间件 + discov.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithTimeout(time.Second*3)) // 默认RPC中间件 gin.SetMode(gin.ReleaseMode) //f, _ := os.Create("../logs/api.log") //gin.DefaultWriter = io.MultiWriter(f)