mirror of
https://github.com/usememos/memos.git
synced 2024-12-24 11:44:44 +03:00
parent
76d955a69a
commit
0f4e5857f0
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -14,11 +13,9 @@ import (
|
|||||||
"github.com/labstack/echo/v4/middleware"
|
"github.com/labstack/echo/v4/middleware"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
echoSwagger "github.com/swaggo/echo-swagger"
|
echoSwagger "github.com/swaggo/echo-swagger"
|
||||||
"go.uber.org/zap"
|
|
||||||
|
|
||||||
apiv1 "github.com/usememos/memos/api/v1"
|
apiv1 "github.com/usememos/memos/api/v1"
|
||||||
apiv2 "github.com/usememos/memos/api/v2"
|
apiv2 "github.com/usememos/memos/api/v2"
|
||||||
"github.com/usememos/memos/internal/log"
|
|
||||||
"github.com/usememos/memos/plugin/telegram"
|
"github.com/usememos/memos/plugin/telegram"
|
||||||
"github.com/usememos/memos/server/integration"
|
"github.com/usememos/memos/server/integration"
|
||||||
"github.com/usememos/memos/server/profile"
|
"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.telegramBot.Start(ctx)
|
||||||
go s.backupRunner.Run(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")
|
metric.Enqueue("server start")
|
||||||
return s.e.Start(fmt.Sprintf("%s:%d", s.Profile.Addr, s.Profile.Port))
|
return s.e.Start(fmt.Sprintf("%s:%d", s.Profile.Addr, s.Profile.Port))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user