MCPcopy
hub / github.com/grpc/grpc-go / startFlushGoroutine

Method startFlushGoroutine

internal/binarylog/sink.go:117–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115)
116
117func (fs *bufferedSink) startFlushGoroutine() {
118 fs.writeTicker = time.NewTicker(bufFlushDuration)
119 go func() {
120 for {
121 select {
122 case <-fs.done:
123 return
124 case <-fs.writeTicker.C:
125 }
126 fs.mu.Lock()
127 if err := fs.buf.Flush(); err != nil {
128 grpclogLogger.Warningf("failed to flush to Sink: %v", err)
129 }
130 fs.mu.Unlock()
131 }
132 }()
133}
134
135func (fs *bufferedSink) Close() error {
136 fs.mu.Lock()

Callers 1

WriteMethod · 0.95

Calls 4

FlushMethod · 0.65
WarningfMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected