model, add_build: first put the files into place, then commit to the database

This commit is contained in:
Robur 2024-01-09 16:37:39 +00:00
parent 5d4d84f705
commit 22f3eb3893

View file

@ -463,8 +463,8 @@ let add_build
Db.exec Build_artifact.add (file, id)) Db.exec Build_artifact.add (file, id))
(Lwt_result.return ()) (Lwt_result.return ())
remaining_artifacts_to_add >>= fun () -> 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 main_binary
in in
Lwt_result.bind_lwt_error (or_cleanup r) Lwt_result.bind_lwt_error (or_cleanup r)