fix get_url test to take config.url into account

This commit is contained in:
Corentin Leruth 2023-08-28 17:07:39 +02:00 committed by Simon Cruanes
parent 329d45ee45
commit a62f1d891a
3 changed files with 7 additions and 2 deletions

View file

@ -559,6 +559,9 @@ end
let setup_ ?(stop = Atomic.make false) ~(config : Config.t) () =
debug_ := config.debug;
if config.url <> get_url () then set_url config.url;
let module B =
Backend
(struct

View file

@ -446,6 +446,8 @@ let setup_ ?(stop = Atomic.make false) ~(config : Config.t) () =
let ((module B) as backend) = mk_backend ~stop ~config () in
Opentelemetry.Collector.set_backend backend;
if config.url <> get_url () then set_url config.url;
if config.ticker_thread then (
let sleep_ms = min 5_000 (max 2 config.batch_timeout_ms) in
ignore (setup_ticker_thread ~stop ~sleep_ms backend () : Thread.t)

View file

@ -1,2 +1,2 @@
ocurl url = http://localhost:4318
cohttp url = http://localhost:4318
ocurl url = http://localhost:3000
cohttp url = http://localhost:3000