From 0f4e5857f0744993715487de0b2be5e52e732e66 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Fri, 27 Oct 2023 21:38:17 +0800 Subject: [PATCH] chore: remove gRPC listener (#2456) Disable gRPC listener --- server/server.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/server/server.go b/server/server.go index 837a120f..fbfc5db4 100644 --- a/server/server.go +++ b/server/server.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "net" "net/http" "strings" "time" @@ -14,11 +13,9 @@ import ( "github.com/labstack/echo/v4/middleware" "github.com/pkg/errors" echoSwagger "github.com/swaggo/echo-swagger" - "go.uber.org/zap" apiv1 "github.com/usememos/memos/api/v1" apiv2 "github.com/usememos/memos/api/v2" - "github.com/usememos/memos/internal/log" "github.com/usememos/memos/plugin/telegram" "github.com/usememos/memos/server/integration" "github.com/usememos/memos/server/profile" @@ -122,17 +119,6 @@ func (s *Server) Start(ctx context.Context) error { go s.telegramBot.Start(ctx) go s.backupRunner.Run(ctx) - // Start gRPC server. - listen, err := net.Listen("tcp", fmt.Sprintf("%s:%d", s.Profile.Addr, s.Profile.Port+1)) - if err != nil { - return err - } - go func() { - if err := s.apiV2Service.GetGRPCServer().Serve(listen); err != nil { - log.Error("grpc server listen error", zap.Error(err)) - } - }() - metric.Enqueue("server start") return s.e.Start(fmt.Sprintf("%s:%d", s.Profile.Addr, s.Profile.Port)) }