Remove ugly garbage in startup

This commit is contained in:
Rawley
2023-01-02 08:37:57 -06:00
committed by GitHub
parent 069ea54e11
commit 3b312a537a

View File

@@ -1,13 +1,9 @@
open Lwt.Infix open Lwt.Infix
open Lwt.Syntax
let db_created = ref true let () = Lwt_main.run @@ Database.create_blog_post_table () >>= function
let _ = Database.create_blog_post_table () >>= function
| Ok () -> Lwt_io.print "Database initialized successfully.\n" | Ok () -> Lwt_io.print "Database initialized successfully.\n"
| Error _ -> Lwt.return (db_created := false) | Error e -> failwith (Caqti_error.show e)
let () = Unix.sleepf 2.0
let () = if not !db_created then failwith "Could not initialize database"
let () = let () =
Dream.run Dream.run