Ensures retry is tailrec

Summary: Hopefully next time the backtrace will be shorter.

Reviewed By: jberdine

Differential Revision: D5931724

fbshipit-source-id: 2fb39e8
master
Mehdi Bouaziz 7 years ago committed by Facebook Github Bot
parent 959665f5bd
commit e8ca44c808

@ -46,7 +46,7 @@ let retry_exception ~timeout ~catch_exn ~f x =
let expired () = Unix.gettimeofday () -. init_time >= timeout in let expired () = Unix.gettimeofday () -. init_time >= timeout in
let rec retry () = let rec retry () =
try f x try f x
with e when catch_exn e && not (expired ()) -> retry () with e when catch_exn e && not (expired ()) -> (retry [@tailcall]) ()
in in
retry () retry ()

Loading…
Cancel
Save