🐛 Close user guide when exiting https://ld246.com/article/1708782043043

This commit is contained in:
Daniel 2024-02-25 22:36:23 +08:00
parent 671667981d
commit 1f22ee3d7e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1011,11 +1011,20 @@ func closeUserGuide() {
}
msgId := util.PushMsg(Conf.language(233), 30000)
evt := util.NewCmdResult("unmount", 0, util.PushModeBroadcast)
evt.Data = map[string]interface{}{
"box": boxID,
}
util.PushEvent(evt)
unindex(boxID)
if removeErr := filelock.Remove(boxDirPath); nil != removeErr {
logging.LogErrorf("remove corrupted user guide box [%s] failed: %s", boxDirPath, removeErr)
}
sql.WaitForWritingDatabase()
util.PushClearMsg(msgId)
logging.LogInfof("closed user guide box [%s]", boxID)
}