fix: compat with lwt < 5.7

This commit is contained in:
Simon Cruanes 2025-01-31 16:50:11 -05:00
parent 92613d8526
commit 66573bd1ac
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -8,6 +8,10 @@ module Config = Config
open Opentelemetry
include Common_
external reraise : exn -> 'a = "%reraise"
(** This is equivalent to [Lwt.reraise]. We inline it here so we don't force
to use Lwt's latest version *)
let needs_gc_metrics = Atomic.make false
let last_gc_metrics = Atomic.make (Mtime_clock.now ())
@ -605,6 +609,6 @@ let with_setup ?stop ?(config = Config.make ()) ?(enable = true) () f : _ Lwt.t
(fun exn ->
cleanup ();
let* () = cleanup_done in
Lwt.reraise exn)
reraise exn)
else
f ()