platform: Add group expand status

This commit is contained in:
世界
2023-08-12 19:33:43 +08:00
parent cf57e46d69
commit 9f94b21687
7 changed files with 131 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ package libbox
import (
"context"
"net/netip"
runtimeDebug "runtime/debug"
"syscall"
"github.com/sagernet/sing-box"
@@ -35,6 +36,7 @@ func NewService(configContent string, platformInterface PlatformInterface) (*Box
if err != nil {
return nil, err
}
runtimeDebug.FreeOSMemory()
ctx, cancel := context.WithCancel(context.Background())
ctx = filemanager.WithDefault(ctx, sWorkingPath, sTempPath, sUserID, sGroupID)
ctx = service.ContextWithPtr(ctx, urltest.NewHistoryStorage())
@@ -49,6 +51,7 @@ func NewService(configContent string, platformInterface PlatformInterface) (*Box
cancel()
return nil, E.Cause(err, "create service")
}
runtimeDebug.FreeOSMemory()
return &BoxService{
ctx: ctx,
cancel: cancel,