Skip to content

Commit

Permalink
Merge pull request #64 from inf-rno/master
Browse files Browse the repository at this point in the history
Fix janitor stop channel data race
  • Loading branch information
patrickmn authored Jul 22, 2017
2 parents 7ac1518 + 0640633 commit a3647f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,6 @@ type janitor struct {
}

func (j *janitor) Run(c *cache) {
j.stop = make(chan bool)
ticker := time.NewTicker(j.Interval)
for {
select {
Expand All @@ -1094,6 +1093,7 @@ func stopJanitor(c *Cache) {
func runJanitor(c *cache, ci time.Duration) {
j := &janitor{
Interval: ci,
stop: make(chan bool),
}
c.janitor = j
go j.Run(c)
Expand Down

0 comments on commit a3647f8

Please sign in to comment.