Skip to content

Commit

Permalink
in remove_backend, call tick() then cleanup() on it
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Oct 16, 2024
1 parent 0ef97a0 commit 1924ff7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/opentelemetry.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ module Collector = struct

(** Remove current backend, if any.
@since NEXT_RELEASE *)
let remove_backend () : unit = Atomic.set backend None
let remove_backend () : unit =
match Atomic.exchange backend None with
| None -> ()
| Some (module B) ->
B.tick ();
B.cleanup ()

(** Is there a configured backend? *)
let[@inline] has_backend () : bool = Atomic.get backend != None
Expand Down

0 comments on commit 1924ff7

Please sign in to comment.