From 6b53ae502d9064b9a53ba0955c7e6fce10a536d6 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Sun, 19 Dec 2021 02:23:51 +0800 Subject: [PATCH] fix: crash --- system/system.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/system.go b/system/system.go index 5ea8ebc..e8fbc17 100644 --- a/system/system.go +++ b/system/system.go @@ -143,8 +143,10 @@ func (sys *System) Start() { if sys.status == sys_restart { isRestart = true } - - history.Send(history.Info().Nm("SysDown").Msg("system stoped")) + // only log if system has started + if sys.status == sys_wait { + history.Send(history.Info().Nm("SysDown").Msg("system stoped")) + } l.Info().Msg("Terminating...") sys.status = sys_term go func() {