Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed May 26, 2023
1 parent 85fa954 commit bbabd1b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions modules/log/event_writer_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,16 @@ func (b *EventWriterBaseImpl) Run(ctx context.Context) {
}
}

for {
if b.GetPauseChan != nil {
pause := b.GetPauseChan()
if pause != nil {
select {
case <-pause:
case <-ctx.Done():
return
}
handlePaused := func() {
if pause := b.GetPauseChan(); pause != nil {
select {
case <-pause:
case <-ctx.Done():
}
}
}

for {
select {
case <-ctx.Done():
return
Expand All @@ -88,6 +86,8 @@ func (b *EventWriterBaseImpl) Run(ctx context.Context) {
return
}

handlePaused()

if exprRegexp != nil {
fileLineCaller := fmt.Sprintf("%s:%d:%s", event.Origin.Filename, event.Origin.Line, event.Origin.Caller)
matched := exprRegexp.Match([]byte(fileLineCaller)) || exprRegexp.Match([]byte(event.Origin.MsgSimpleText))
Expand Down

0 comments on commit bbabd1b

Please sign in to comment.