openobserve(log): fix sendDebounceFunc not reset

This commit is contained in:
Tigor Hutasuhut 2024-04-14 17:29:16 +07:00
parent 24c5907e54
commit 6edf2c534d

View file

@ -46,6 +46,7 @@ func (sl *OpenObserveHandler) Handle(ctx context.Context, record slog.Record) er
sl.sendDebounceFunc = time.AfterFunc(sl.opts.BufferTimeout, func() { sl.sendDebounceFunc = time.AfterFunc(sl.opts.BufferTimeout, func() {
sl.mu.Lock() sl.mu.Lock()
defer sl.mu.Unlock() defer sl.mu.Unlock()
sl.sendDebounceFunc = nil
if sl.buffer.Len() < 1 { if sl.buffer.Len() < 1 {
return return
} }