mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-05 16:46:58 +08:00
chore: add more log
This commit is contained in:
@@ -356,9 +356,18 @@ func (r *Stream) action(action StreamAction) (ok bool) {
|
|||||||
r.Subscribers.Dispose()
|
r.Subscribers.Dispose()
|
||||||
r.actionChan.Close()
|
r.actionChan.Close()
|
||||||
}
|
}
|
||||||
|
if actionCoust := time.Since(event.Time); actionCoust > 100*time.Millisecond {
|
||||||
|
r.Warn("action timeout", zap.String("action", action.String()), zap.Duration("cost", actionCoust))
|
||||||
|
}
|
||||||
EventBus <- stateEvent
|
EventBus <- stateEvent
|
||||||
|
if actionCoust := time.Since(event.Time); actionCoust > 100*time.Millisecond {
|
||||||
|
r.Warn("action timeout after eventbus", zap.String("action", action.String()), zap.Duration("cost", actionCoust))
|
||||||
|
}
|
||||||
if r.Publisher != nil {
|
if r.Publisher != nil {
|
||||||
r.Publisher.OnEvent(stateEvent)
|
r.Publisher.OnEvent(stateEvent)
|
||||||
|
if actionCoust := time.Since(event.Time); actionCoust > 100*time.Millisecond {
|
||||||
|
r.Warn("action timeout after send to publisher", zap.String("action", action.String()), zap.Duration("cost", actionCoust))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r.Debug("wrong action", zap.String("action", action.String()))
|
r.Debug("wrong action", zap.String("action", action.String()))
|
||||||
|
@@ -126,7 +126,7 @@ func (s *Subscribers) Find(id string) ISubscriber {
|
|||||||
func (s *Subscribers) Delete(suber ISubscriber) {
|
func (s *Subscribers) Delete(suber ISubscriber) {
|
||||||
io := suber.GetSubscriber()
|
io := suber.GetSubscriber()
|
||||||
for _, reader := range io.readers {
|
for _, reader := range io.readers {
|
||||||
reader.Track.ReaderCount.Add(-1)
|
reader.Track.Debug("reader -1", zap.Int32("count", reader.Track.ReaderCount.Add(-1)))
|
||||||
}
|
}
|
||||||
if _, ok := s.public[suber]; ok {
|
if _, ok := s.public[suber]; ok {
|
||||||
delete(s.public, suber)
|
delete(s.public, suber)
|
||||||
|
@@ -44,7 +44,7 @@ func (r *AVRingReader) DecConfChanged() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewAVRingReader(t *Media) *AVRingReader {
|
func NewAVRingReader(t *Media) *AVRingReader {
|
||||||
t.ReaderCount.Add(1)
|
t.Debug("reader +1", zap.Int32("count", t.ReaderCount.Add(1)))
|
||||||
return &AVRingReader{
|
return &AVRingReader{
|
||||||
Track: t,
|
Track: t,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user