Skip to content

Commit

Permalink
Fix cpu leak from unclosed tickers (#21)
Browse files Browse the repository at this point in the history
* fix ticker-related cpu leak

* Update CHANGELOG.md
  • Loading branch information
Reidmcc authored Feb 23, 2019
1 parent 970ce57 commit 4f2383d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

### Unreleased
- Fixed a cpu leak from unclosed tickers in stream routines

## v 0.3.0-alpha

Expand Down
4 changes: 1 addition & 3 deletions modules/dexWatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,8 @@ func (w *DexWatcher) streamOld(
defer resp.Body.Close()

reader := bufio.NewReader(resp.Body)
ticker := time.NewTicker(10 * time.Millisecond)

for {
<-ticker.C
time.Sleep(10 * time.Millisecond)
Events:
for {
var buffer bytes.Buffer
Expand Down

0 comments on commit 4f2383d

Please sign in to comment.