objective categorical abstract machine language personal data server
65
fork

Configure Feed

Select the types of activity you want to include in your feed.

Time out proxied requests

futurGH f2f31f70 f325423a

+10 -2
+10 -2
pegasus/lib/xrpc.ml
··· 114 114 in 115 115 match Dream.method_ ctx.req with 116 116 | `GET -> ( 117 - let%lwt res, body = Util.http_get uri ~headers in 117 + let%lwt res, body = 118 + try%lwt Lwt_unix.with_timeout 15.0 (fun () -> Util.http_get uri ~headers) 119 + with Lwt_unix.Timeout -> 120 + Errors.internal_error ~msg:"proxy request timed out" () 121 + in 118 122 let res_headers = 119 123 Cohttp.Response.headers res |> Cohttp.Header.to_list 120 124 in ··· 131 135 | `POST -> ( 132 136 let%lwt req_body = Dream.body ctx.req in 133 137 let%lwt res, body = 134 - Client.post uri ~headers ~body:(Body.of_string req_body) 138 + try%lwt 139 + Lwt_unix.with_timeout 15.0 (fun () -> 140 + Client.post uri ~headers ~body:(Body.of_string req_body) ) 141 + with Lwt_unix.Timeout -> 142 + Errors.internal_error ~msg:"proxy request timed out" () 135 143 in 136 144 let res_headers = 137 145 Cohttp.Response.headers res |> Cohttp.Header.to_list