Skip to content

Commit

Permalink
fix(perf): slow down goroutines loop to significantly reduce cpu usage
Browse files Browse the repository at this point in the history
  • Loading branch information
hbollon committed Oct 26, 2021
1 parent d020662 commit f0d8739
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func launchBot(ctx context.Context) {
default:
break
}
time.Sleep(10 * time.Millisecond)
}
}

Expand Down
2 changes: 2 additions & 0 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func (s *Selenium) SigTermCleaning() {
default:
break
}
time.Sleep(10 * time.Millisecond)
}
}()
}
Expand Down Expand Up @@ -265,5 +266,6 @@ func (s *Selenium) WaitForElement(elementTag, locator string, delay int) (bool,
return true, nil
}
}
time.Sleep(10 * time.Millisecond)
}
}
1 change: 1 addition & 0 deletions internal/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func (p *Proxy) LaunchLocalForwarder() error {
default:
break
}
time.Sleep(10 * time.Millisecond)
}
}()
time.Sleep(5 * time.Second)
Expand Down

0 comments on commit f0d8739

Please sign in to comment.