From f2b4c5eaf5d8cbbf57f06241dd34dc4389d69549 Mon Sep 17 00:00:00 2001 From: Adelyn Breedlove Date: Sun, 17 Feb 2019 21:02:43 -0700 Subject: Add rate limit log at debug level --- lib/http/http.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/http') diff --git a/lib/http/http.ml b/lib/http/http.ml index e1b2998..5288aac 100644 --- a/lib/http/http.ml +++ b/lib/http/http.ml @@ -64,7 +64,10 @@ module Base = struct | _ -> raise Invalid_Method) >>= process_response path in if limit.remaining > 0 then process () - else Clock.at (Core.Time.(Span.of_int_sec limit.reset |> of_span_since_epoch)) >>= process + else + let time = Time.(Span.of_int_sec limit.reset |> of_span_since_epoch) in + Logs.debug (fun m -> m "Rate-limiting [Route: %s] [Duration: %d ms]" path Time.(diff time (Time.now ()) |> Span.to_ms |> Float.to_int) ); + Clock.at time >>= process end let get_gateway () = -- cgit v1.2.3