Remove unnecessary context wrappers

This commit is contained in:
世界
2023-12-16 15:40:14 +08:00
parent 89c723e3e4
commit 2e607118c3
6 changed files with 12 additions and 10 deletions

View File

@@ -44,8 +44,6 @@ func NewService(configContent string, platformInterface PlatformInterface) (*Box
ctx = filemanager.WithDefault(ctx, sWorkingPath, sTempPath, sUserID, sGroupID)
urlTestHistoryStorage := urltest.NewHistoryStorage()
ctx = service.ContextWithPtr(ctx, urlTestHistoryStorage)
pauseManager := pause.NewDefaultManager(ctx)
ctx = pause.ContextWithManager(ctx, pauseManager)
platformWrapper := &platformInterfaceWrapper{iif: platformInterface, useProcFS: platformInterface.UseProcFS()}
instance, err := box.New(box.Options{
Context: ctx,
@@ -63,7 +61,7 @@ func NewService(configContent string, platformInterface PlatformInterface) (*Box
cancel: cancel,
instance: instance,
urlTestHistoryStorage: urlTestHistoryStorage,
pauseManager: pauseManager,
pauseManager: service.FromContext[pause.Manager](ctx),
}, nil
}