chore: tweak linter

This commit is contained in:
Steven 2024-04-18 21:44:46 +08:00
parent 5d967f41d9
commit 2a93b8d720
2 changed files with 4 additions and 6 deletions

View File

@ -12,7 +12,6 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/usememos/memos/internal/jobs"
"github.com/usememos/memos/server"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/store"
@ -85,10 +84,7 @@ var (
printGreetings()
// update (pre-sign) object storage links if applicable
go jobs.RunPreSignLinks(ctx, storeInstance)
if err := s.Start(ctx); err != nil {
if err := s.Start(); err != nil {
if err != http.ErrServerClosed {
slog.Error("failed to start server", err)
cancel()

View File

@ -15,6 +15,7 @@ import (
"github.com/soheilhy/cmux"
"google.golang.org/grpc"
"github.com/usememos/memos/internal/jobs"
storepb "github.com/usememos/memos/proto/gen/store"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/route/api/auth"
@ -103,7 +104,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
return s, nil
}
func (s *Server) Start(ctx context.Context) error {
func (s *Server) Start() error {
address := fmt.Sprintf(":%d", s.Profile.Port)
listener, err := net.Listen("tcp", address)
if err != nil {
@ -146,6 +147,7 @@ func (s *Server) Shutdown(ctx context.Context) {
}
func (s *Server) StartRunners(ctx context.Context) {
go jobs.RunPreSignLinks(ctx, s.Store)
go versionchecker.NewVersionChecker(s.Store, s.Profile).Start(ctx)
}