Avoid opening log output before start &

Replace tracing logs with task monitor
This commit is contained in:
世界
2023-12-04 11:47:25 +08:00
parent 25810b50c1
commit 21283b554a
14 changed files with 231 additions and 266 deletions

View File

@@ -13,6 +13,7 @@ import (
"time"
"github.com/sagernet/sing-box"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
E "github.com/sagernet/sing/common/exceptions"
@@ -193,7 +194,7 @@ func run() error {
}
func closeMonitor(ctx context.Context) {
time.Sleep(3 * time.Second)
time.Sleep(C.DefaultStopFatalTimeout)
select {
case <-ctx.Done():
return