From e2d3862e647ac72e98886a31eeac2a87cd791564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 12 Mar 2024 14:22:31 +0800 Subject: [PATCH] platform: reset network on invalid power events --- experimental/libbox/service_pause.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/experimental/libbox/service_pause.go b/experimental/libbox/service_pause.go index 4a58fb50..921e48d5 100644 --- a/experimental/libbox/service_pause.go +++ b/experimental/libbox/service_pause.go @@ -13,33 +13,28 @@ type servicePauseFields struct { func (s *BoxService) Pause() { s.pauseAccess.Lock() defer s.pauseAccess.Unlock() - if s.pauseTimer != nil { s.pauseTimer.Stop() } - s.pauseTimer = time.AfterFunc(time.Minute, s.pause) } func (s *BoxService) pause() { s.pauseAccess.Lock() defer s.pauseAccess.Unlock() - s.pauseManager.DevicePause() _ = s.instance.Router().ResetNetwork() s.pauseTimer = nil } func (s *BoxService) Wake() { + _ = s.instance.Router().ResetNetwork() s.pauseAccess.Lock() defer s.pauseAccess.Unlock() - if s.pauseTimer != nil { s.pauseTimer.Stop() s.pauseTimer = nil return } - s.pauseManager.DeviceWake() - _ = s.instance.Router().ResetNetwork() }