From 1b0ed4afc16fcf665a61021a088f88c64dc88674 Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify-com@users.noreply.github.com> Date: Sun, 21 Jan 2024 10:56:55 +0000 Subject: [PATCH] update to singbox 1.8.2 --- cmd/main.go | 4 +++- custom/service.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 3656795..097116e 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,6 +4,8 @@ import ( "os" "time" + "context" + "github.com/sagernet/sing-box/log" "github.com/spf13/cobra" @@ -32,7 +34,7 @@ func main() { func preRun(cmd *cobra.Command, args []string) { if disableColor { - log.SetStdLogger(log.NewFactory(log.Formatter{BaseTime: time.Now(), DisableColors: true}, os.Stderr, nil).Logger()) + log.SetStdLogger(log.NewDefaultFactory(context.Background(), log.Formatter{BaseTime: time.Now(), DisableColors: true}, os.Stderr, "", nil, false).Logger()) } if workingDir != "" { _, err := os.Stat(workingDir) diff --git a/custom/service.go b/custom/service.go index b677c98..9f2bc66 100644 --- a/custom/service.go +++ b/custom/service.go @@ -36,8 +36,8 @@ func NewService(options option.Options) (*libbox.BoxService, error) { 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) + pauseManager := pause.WithDefaultManager(ctx) + // ctx = pause.ContextWithManager(ctx, pauseManager) instance, err := B.New(B.Options{ Context: ctx, Options: options,