From 6a1c8b0ecd55a1a321f3b818ea7108d59b9eebe8 Mon Sep 17 00:00:00 2001 From: rand00 Date: Mon, 11 Apr 2022 18:12:23 +0200 Subject: [PATCH] Builder_web_app: Fixed type-error + some 80-column fixes --- bin/builder_web_app.ml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/bin/builder_web_app.ml b/bin/builder_web_app.ml index 9b61a3e..7d20e03 100644 --- a/bin/builder_web_app.ml +++ b/bin/builder_web_app.ml @@ -81,18 +81,32 @@ let init_influx name data = let setup_app level influx port host datadir cachedir configdir = let dbpath = Printf.sprintf "%s/builder.sqlite3" datadir in let datadir = Fpath.v datadir in - let cachedir = Option.fold ~none:Fpath.(datadir / "_cache") ~some:Fpath.v in + let cachedir = + cachedir |> Option.fold ~none:Fpath.(datadir / "_cache") ~some:Fpath.v + in let configdir = Fpath.v configdir in let () = init_influx "builder-web" influx in match Builder_web.init dbpath datadir with | Error (#Caqti_error.load as e) -> Format.eprintf "Error: %a\n%!" Caqti_error.pp e; exit 2 - | Error (#Caqti_error.connect | #Caqti_error.call_or_retrieve | `Msg _ | `Wrong_version _ as e) -> + | Error ( + #Caqti_error.connect + | #Caqti_error.call_or_retrieve + | `Msg _ + | `Wrong_version _ as e + ) -> Format.eprintf "Error: %a\n%!" Builder_web.pp_error e; exit 1 | Ok () -> - let level = match level with None -> None | Some Logs.Debug -> Some `Debug | Some Info -> Some `Info | Some Warning -> Some `Warning | Some Error -> Some `Error | Some App -> None in + let level = match level with + | None -> None + | Some Logs.Debug -> Some `Debug + | Some Info -> Some `Info + | Some Warning -> Some `Warning + | Some Error -> Some `Error + | Some App -> None + in Dream.initialize_log ?level (); Dream.run ~port ~interface:host ~https:false @@ Dream.logger