🚧 Optimize
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -45,6 +47,13 @@ func NewBackupService(configService *ConfigService, dbService *DatabaseService,
|
||||
}
|
||||
}
|
||||
|
||||
func (ds *BackupService) ServiceStartup(ctx context.Context, options application.ServiceOptions) error {
|
||||
if err := ds.Initialize(); err != nil {
|
||||
return fmt.Errorf("initializing backup service: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Initialize 初始化备份服务
|
||||
func (s *BackupService) Initialize() error {
|
||||
config, repoPath, err := s.getConfigAndPath()
|
||||
|
||||
Reference in New Issue
Block a user