Fix build

This commit is contained in:
problematicconsumer
2023-10-13 14:56:40 +03:30
parent 7b3012b966
commit ac0eddc583
4 changed files with 13 additions and 6 deletions

View File

@@ -20,6 +20,10 @@ func (cch *CommandClientHandler) Disconnected(message string) {
fmt.Printf("disconnected: %s\n", message)
}
func (cch *CommandClientHandler) ClearLog() {
fmt.Println("clear log")
}
func (cch *CommandClientHandler) WriteLog(message string) {
fmt.Printf("new log: %s\n", message)
}

View File

@@ -3,6 +3,7 @@ package main
import (
"context"
"os"
runtimeDebug "runtime/debug"
B "github.com/sagernet/sing-box"
"github.com/sagernet/sing-box/common/urltest"
@@ -30,6 +31,7 @@ func Setup(basePath string, workingPath string, tempPath string) {
}
func NewService(options option.Options) (*libbox.BoxService, error) {
runtimeDebug.FreeOSMemory()
ctx, cancel := context.WithCancel(context.Background())
ctx = filemanager.WithDefault(ctx, sWorkingPath, sTempPath, sUserID, sGroupID)
urlTestHistoryStorage := urltest.NewHistoryStorage()
@@ -44,6 +46,7 @@ func NewService(options option.Options) (*libbox.BoxService, error) {
cancel()
return nil, E.Cause(err, "create service")
}
runtimeDebug.FreeOSMemory()
service := libbox.NewBoxService(
ctx,
cancel,