Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a3647f8

Browse files
authoredJul 22, 2017
Merge pull request #64 from inf-rno/master
Fix janitor stop channel data race
2 parents 7ac1518 + 0640633 commit a3647f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎cache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,6 @@ type janitor struct {
10741074
}
10751075

10761076
func (j *janitor) Run(c *cache) {
1077-
j.stop = make(chan bool)
10781077
ticker := time.NewTicker(j.Interval)
10791078
for {
10801079
select {
@@ -1094,6 +1093,7 @@ func stopJanitor(c *Cache) {
10941093
func runJanitor(c *cache, ci time.Duration) {
10951094
j := &janitor{
10961095
Interval: ci,
1096+
stop: make(chan bool),
10971097
}
10981098
c.janitor = j
10991099
go j.Run(c)

0 commit comments

Comments
 (0)
Please sign in to comment.