Skip to content

Commit

Permalink
Fix variable scope bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Acosta committed Feb 8, 2016
1 parent 53bc710 commit 98423d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion probe/endpoint/procspy/background_reader_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (br *backgroundReader) loop(walker process.Walker) {
walkc chan map[uint64]*Proc // initially nil, i.e. off
walkBuf = bytes.NewBuffer(make([]byte, 0, 5000))
rateLimitPeriod = initialRateLimitPeriod
nextInterval time.Duration
ticker = time.NewTicker(rateLimitPeriod)
pWalker = newPidWalker(walker, ticker.C, fdBlockSize)
)
Expand All @@ -80,7 +81,7 @@ func (br *backgroundReader) loop(walker process.Walker) {

// Schedule next walk and adjust rate limit
walkTime := time.Since(begin)
rateLimitPeriod, nextInterval := scheduleNextWalk(rateLimitPeriod, walkTime)
rateLimitPeriod, nextInterval = scheduleNextWalk(rateLimitPeriod, walkTime)
ticker.Stop()
ticker := time.NewTicker(rateLimitPeriod)
pWalker.ticker = ticker.C
Expand Down

0 comments on commit 98423d3

Please sign in to comment.