Skip to content

Commit

Permalink
优化错误判断
Browse files Browse the repository at this point in the history
  • Loading branch information
keac committed May 18, 2024
1 parent f8c5977 commit ca2965c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions enscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ func main() {
gologger.Error().Msgf("任务未完成退出,自动保存过程文件!")
enDataList := make(map[string][]map[string]string)
close(runner.EnCh)
for ch := range runner.EnCh {
utils.MergeMap(ch, enDataList)
}
err := common.OutFileByEnInfo(enDataList, "意外退出保存文件", "xlsx", "outs")
if err != nil {
gologger.Error().Msgf(err.Error())
if len(runner.EnCh) > 0 {
for ch := range runner.EnCh {
utils.MergeMap(ch, enDataList)
}
err := common.OutFileByEnInfo(enDataList, "意外退出保存文件", "xlsx", "outs")
if err != nil {
gologger.Error().Msgf(err.Error())
}
}
log.Fatal("exit.by.signal")
}
Expand Down

0 comments on commit ca2965c

Please sign in to comment.