Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Oct 17, 2024
1 parent 424a82c commit 308e030
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/client-cohttp-lwt/opentelemetry_client_cohttp_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,7 @@ let setup_ ?stop ?config () =
let backend = create_backend ?stop ?config () in
let (module B : OT.Collector.BACKEND) = backend in
OT.Collector.set_backend backend;
let cleanup () =
B.tick ();
B.cleanup ()
in
cleanup
OT.Collector.remove_backend

let setup ?stop ?config ?(enable = true) () =
if enable then (
Expand Down
7 changes: 1 addition & 6 deletions src/client-ocurl/opentelemetry_client_ocurl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,7 @@ let setup_ ?(stop = Atomic.make false) ?(config : Config.t = Config.make ()) ()
let sleep_ms = min 60_000 (max 2 config.ticker_interval_ms) in
ignore (setup_ticker_thread ~stop ~sleep_ms backend () : Thread.t)
);

let cleanup () =
B.tick ();
B.cleanup ()
in
cleanup
OT.Collector.remove_backend

let setup ?stop ?config ?(enable = true) () =
if enable then (
Expand Down

0 comments on commit 308e030

Please sign in to comment.