mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
simplified loop over channel inputs
This commit is contained in:
parent
8f7c23ff4a
commit
42adb6a25a
@ -24,13 +24,10 @@ func newStats() *stats {
|
|||||||
chanCount: make(chan int),
|
chanCount: make(chan int),
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for _ = range s.chanCount {
|
||||||
select {
|
|
||||||
case <-s.chanCount:
|
|
||||||
s.requests++
|
s.requests++
|
||||||
s.chanCount <- 1
|
s.chanCount <- 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user