mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
fix: do not emit empty batches
This commit is contained in:
parent
16667a3fcf
commit
41e9962c08
1 changed files with 2 additions and 3 deletions
|
|
@ -240,13 +240,12 @@ end = struct
|
|||
|
||||
let pop_if_ready ?(force = false) ~now (self : _ t) : _ list option =
|
||||
let@ () = with_mutex_ self.lock in
|
||||
if
|
||||
(force && not (is_empty_ self))
|
||||
|| is_full_ self || timeout_expired_ ~now self
|
||||
if self.size > 0 && (force || is_full_ self || timeout_expired_ ~now self)
|
||||
then (
|
||||
let l = self.q in
|
||||
self.q <- [];
|
||||
self.size <- 0;
|
||||
assert (l <> []);
|
||||
Some l
|
||||
) else
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue