Skip to content

Commit

Permalink
修复#2,输出的数据库文件不完整故障
Browse files Browse the repository at this point in the history
  • Loading branch information
wiselike authored and hengwu0 committed Sep 27, 2022
1 parent 4de57df commit 71ec830
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Afflux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ func main() {
go PTraceModule(pBuffer)
//启动BuildLog模块
blog.BuildLogMain(VdatOut)
go func(wg *sync.WaitGroup) { wg.Add(1); blog.Tar(VdatOut); wg.Done() }(&wg)
//生成数据库文件
wg.Add(1)
go func(wg *sync.WaitGroup) { blog.Tar(VdatOut); wg.Done() }(&wg)
//终端打印结果
olog.BuildLogMain(VdatOut, VlogOut, nil, Vomits, Vsort)
case 2:
olog.BuildLogMain(VdatIn, VlogOut, nil, Vomits, Vsort)
Expand All @@ -44,7 +47,7 @@ func main() {
}
}

//监控模块
// 监控模块
func PTraceModule(pBuffer chan<- callsys.PtraceRet) {
defer func() {
if err := recover(); err != nil {
Expand Down Expand Up @@ -74,7 +77,7 @@ func PTraceModule(pBuffer chan<- callsys.PtraceRet) {
}
}

//缓冲模块,用于缓冲并整合数据
// 缓冲模块,用于缓冲并整合数据
func TransPtraceToBlog(pBuffer chan callsys.PtraceRet) {
recv := <-pBuffer
if !PtreeInit(recv) {
Expand Down

0 comments on commit 71ec830

Please sign in to comment.