From 020de6887ac53a37174068a55ac222c7d8c4abae Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 16 Oct 2024 13:29:39 -0400 Subject: [PATCH] simplify --- src/client-cohttp-lwt/opentelemetry_client_cohttp_lwt.ml | 6 +----- src/client-ocurl/opentelemetry_client_ocurl.ml | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/client-cohttp-lwt/opentelemetry_client_cohttp_lwt.ml b/src/client-cohttp-lwt/opentelemetry_client_cohttp_lwt.ml index 48ad9c8..cffe8a7 100644 --- a/src/client-cohttp-lwt/opentelemetry_client_cohttp_lwt.ml +++ b/src/client-cohttp-lwt/opentelemetry_client_cohttp_lwt.ml @@ -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 ( diff --git a/src/client-ocurl/opentelemetry_client_ocurl.ml b/src/client-ocurl/opentelemetry_client_ocurl.ml index 8d3ea11..b5412f2 100644 --- a/src/client-ocurl/opentelemetry_client_ocurl.ml +++ b/src/client-ocurl/opentelemetry_client_ocurl.ml @@ -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 (