mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: retire auto backup for sqlite
This commit is contained in:
@ -19,7 +19,6 @@ import (
|
||||
"github.com/usememos/memos/server/frontend"
|
||||
"github.com/usememos/memos/server/integration"
|
||||
"github.com/usememos/memos/server/profile"
|
||||
"github.com/usememos/memos/server/service/backup"
|
||||
"github.com/usememos/memos/server/service/metric"
|
||||
versionchecker "github.com/usememos/memos/server/service/version_checker"
|
||||
"github.com/usememos/memos/store"
|
||||
@ -34,8 +33,7 @@ type Server struct {
|
||||
Store *store.Store
|
||||
|
||||
// Asynchronous runners.
|
||||
backupRunner *backup.BackupRunner
|
||||
telegramBot *telegram.Bot
|
||||
telegramBot *telegram.Bot
|
||||
}
|
||||
|
||||
func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store) (*Server, error) {
|
||||
@ -53,10 +51,6 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
telegramBot: telegram.NewBotWithHandler(integration.NewTelegramHandler(store)),
|
||||
}
|
||||
|
||||
if profile.Driver == "sqlite" {
|
||||
s.backupRunner = backup.NewBackupRunner(store)
|
||||
}
|
||||
|
||||
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
|
||||
Format: `{"time":"${time_rfc3339}","latency":"${latency_human}",` +
|
||||
`"method":"${method}","uri":"${uri}",` +
|
||||
@ -121,10 +115,6 @@ func (s *Server) Start(ctx context.Context) error {
|
||||
go versionchecker.NewVersionChecker(s.Store, s.Profile).Start(ctx)
|
||||
go s.telegramBot.Start(ctx)
|
||||
|
||||
if s.backupRunner != nil {
|
||||
go s.backupRunner.Run(ctx)
|
||||
}
|
||||
|
||||
metric.Enqueue("server start")
|
||||
return s.e.Start(fmt.Sprintf("%s:%d", s.Profile.Addr, s.Profile.Port))
|
||||
}
|
||||
|
Reference in New Issue
Block a user