mirror of
https://github.com/usememos/memos.git
synced 2025-04-03 12:21:15 +02: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/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/usememos/memos/internal/jobs"
|
|
||||||
"github.com/usememos/memos/server"
|
"github.com/usememos/memos/server"
|
||||||
"github.com/usememos/memos/server/profile"
|
"github.com/usememos/memos/server/profile"
|
||||||
"github.com/usememos/memos/store"
|
"github.com/usememos/memos/store"
|
||||||
@ -85,10 +84,7 @@ var (
|
|||||||
|
|
||||||
printGreetings()
|
printGreetings()
|
||||||
|
|
||||||
// update (pre-sign) object storage links if applicable
|
if err := s.Start(); err != nil {
|
||||||
go jobs.RunPreSignLinks(ctx, storeInstance)
|
|
||||||
|
|
||||||
if err := s.Start(ctx); err != nil {
|
|
||||||
if err != http.ErrServerClosed {
|
if err != http.ErrServerClosed {
|
||||||
slog.Error("failed to start server", err)
|
slog.Error("failed to start server", err)
|
||||||
cancel()
|
cancel()
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/soheilhy/cmux"
|
"github.com/soheilhy/cmux"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"github.com/usememos/memos/internal/jobs"
|
||||||
storepb "github.com/usememos/memos/proto/gen/store"
|
storepb "github.com/usememos/memos/proto/gen/store"
|
||||||
"github.com/usememos/memos/server/profile"
|
"github.com/usememos/memos/server/profile"
|
||||||
"github.com/usememos/memos/server/route/api/auth"
|
"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
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) Start(ctx context.Context) error {
|
func (s *Server) Start() error {
|
||||||
address := fmt.Sprintf(":%d", s.Profile.Port)
|
address := fmt.Sprintf(":%d", s.Profile.Port)
|
||||||
listener, err := net.Listen("tcp", address)
|
listener, err := net.Listen("tcp", address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -146,6 +147,7 @@ func (s *Server) Shutdown(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) StartRunners(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)
|
go versionchecker.NewVersionChecker(s.Store, s.Profile).Start(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user