objective categorical abstract machine language personal data server
65
fork

Configure Feed

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

Set timeout on db use_pool

futurGH 7b4d3296 2b196da3

+7 -4
+7 -4
pegasus/lib/util.ml
··· 207 207 Uri.add_query_params' db_uri 208 208 [("create", string_of_bool create); ("write", string_of_bool write)] 209 209 in 210 + let pool_config = Caqti_pool_config.create ~max_size:16 ~max_idle_size:4 () in 210 211 match 211 - Caqti_lwt_unix.connect_pool 212 + Caqti_lwt_unix.connect_pool ~pool_config 212 213 ~post_connect:(fun conn -> Lwt_result.ok @@ _init_connection conn) 213 214 uri 214 215 with ··· 228 229 | Error e -> 229 230 raise (Caqti_error.Exn e) 230 231 231 - let use_pool pool (f : Caqti_lwt.connection -> ('a, Caqti_error.t) Lwt_result.t) 232 - : 'a Lwt.t = 233 - match%lwt Caqti_lwt_unix.Pool.use f pool with 232 + let use_pool ?(timeout = 60.0) pool 233 + (f : Caqti_lwt.connection -> ('a, Caqti_error.t) Lwt_result.t) : 'a Lwt.t = 234 + match%lwt 235 + Lwt_unix.with_timeout timeout (fun () -> Caqti_lwt_unix.Pool.use f pool) 236 + with 234 237 | Ok res -> 235 238 Lwt.return res 236 239 | Error e ->