server: remove Push timeout from sinkPool

This commit is contained in:
Matthew Penner 2022-01-22 10:18:13 -07:00
parent 766692bfe6
commit 86f41c8027
No known key found for this signature in database
GPG Key ID: 31311906AD4CF6D6

View File

@ -2,7 +2,6 @@ package server
import (
"sync"
"time"
)
// sinkPool represents a pool with sinks.
@ -60,12 +59,9 @@ func (p *sinkPool) Destroy() {
func (p *sinkPool) Push(v []byte) {
p.mx.RLock()
for _, c := range p.sinks {
// TODO: should this be done in parallel?
select {
// Send the log output to the channel
case c <- v:
// Timeout after 100 milliseconds, this will cause the write to the channel to be cancelled.
case <-time.After(100 * time.Millisecond):
}
}
p.mx.RUnlock()