From fdc451f7c6d74b2f59c9d2cdbdc880af6cfe5fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 14 Mar 2024 13:40:02 +0800 Subject: [PATCH] platform: Fix missing log on apple platforms --- experimental/libbox/command_server.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/experimental/libbox/command_server.go b/experimental/libbox/command_server.go index 2bd99b8c..ec68b4ca 100644 --- a/experimental/libbox/command_server.go +++ b/experimental/libbox/command_server.go @@ -58,16 +58,19 @@ func (s *CommandServer) SetService(newService *BoxService) { if newService != nil { service.PtrFromContext[urltest.HistoryStorage](newService.ctx).SetHook(s.urlTestUpdate) newService.instance.Router().ClashServer().(*clashapi.Server).SetModeUpdateHook(s.modeUpdate) - s.savedLines.Init() - select { - case s.logReset <- struct{}{}: - default: - } } s.service = newService s.notifyURLTestUpdate() } +func (s *CommandServer) ResetLog() { + s.savedLines.Init() + select { + case s.logReset <- struct{}{}: + default: + } +} + func (s *CommandServer) notifyURLTestUpdate() { select { case s.urlTestUpdate <- struct{}{}: