Log n with ring buffer errors (in addition to size).

This commit is contained in:
Alan Noble 2019-11-22 02:19:21 +00:00
parent 980e48c22c
commit db02c8daa2
1 changed files with 2 additions and 2 deletions

View File

@ -247,12 +247,12 @@ func (s *mtsSender) Write(d []byte) (int, error) {
s.curPid = int(p)
if time.Now().Sub(s.prev) >= s.clipDur && s.curPid == mts.PatPid && len(s.buf) > 0 {
s.prev = time.Now()
_, err := s.ring.Write(s.buf)
n, err := s.ring.Write(s.buf)
if err == nil {
s.ring.Flush()
}
if err != nil {
s.log(logger.Warning, pkg+"mtsSender: ringBuffer write error", "error", err.Error(), "size", len(s.buf))
s.log(logger.Warning, pkg+"mtsSender: ringBuffer write error", "error", err.Error(), "n", n, "size", len(s.buf))
}
s.buf = s.buf[:0]
}