mirror of
https://github.com/usememos/memos.git
synced 2025-02-14 18:30:42 +01:00
chore: update grpc options
This commit is contained in:
parent
deae53c1f1
commit
942052b1ea
@ -61,24 +61,11 @@ func NewAPIV1Service(secret string, profile *profile.Profile, store *store.Store
|
||||
|
||||
// RegisterGateway registers the gRPC-Gateway with the given Echo instance.
|
||||
func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Echo) error {
|
||||
// Override the default service config:
|
||||
// * Set the maximum request/response message size to 100MB.
|
||||
serviceConfig := `
|
||||
{
|
||||
"methodConfig": [
|
||||
{
|
||||
"name": [{}],
|
||||
"maxRequestMessageBytes": 104857600,
|
||||
"maxResponseMessageBytes": 104857600
|
||||
}
|
||||
]
|
||||
}
|
||||
`
|
||||
conn, err := grpc.DialContext(
|
||||
ctx,
|
||||
fmt.Sprintf(":%d", s.Profile.Port),
|
||||
grpc.WithDefaultServiceConfig(serviceConfig),
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100*1024*1024)),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user