mirror of
https://github.com/usememos/memos.git
synced 2024-09-11 12:05:29 +03:00
chore: tweak linter
This commit is contained in:
parent
5d967f41d9
commit
2a93b8d720
@ -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()
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user