From 22f3eb38931acd44ec9cb7002e20c93be1235d62 Mon Sep 17 00:00:00 2001 From: Robur Date: Tue, 9 Jan 2024 16:37:39 +0000 Subject: [PATCH] model, add_build: first put the files into place, then commit to the database --- lib/model.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/model.ml b/lib/model.ml index 59ad22e..c18f148 100644 --- a/lib/model.ml +++ b/lib/model.ml @@ -463,8 +463,8 @@ let add_build Db.exec Build_artifact.add (file, id)) (Lwt_result.return ()) remaining_artifacts_to_add >>= fun () -> - Db.commit () >>= fun () -> - commit_files datadir staging_dir job_name uuid artifacts >|= fun () -> + commit_files datadir staging_dir job_name uuid artifacts >>= fun () -> + Db.commit () >|= fun () -> main_binary in Lwt_result.bind_lwt_error (or_cleanup r)