Skip to content

Commit

Permalink
fix : high cpu usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-arabshahi committed Apr 6, 2022
1 parent 4866eca commit bdfb4a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trafficcapture/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ func (an *analyzer) reload() error {
func (an *analyzer) checkCaptureHandlerError() {
go func() {
for {
time.Sleep(500 * time.Millisecond)
select {
case handlerError := <-an.errorChan:
an.logger.ErrorLog("error recieve : " + handlerError.Error())
notStart := true
for notStart {
time.Sleep(500 * time.Millisecond)
err := an.reload()
if err == nil {
an.logger.Infolog("reload successfull")
Expand Down

0 comments on commit bdfb4a0

Please sign in to comment.