summaryrefslogtreecommitdiff
path: root/src/vyconfd.ml
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-11-01 22:12:34 -0500
committerJohn Estabrook <jestabro@vyos.io>2025-11-01 22:18:19 -0500
commitb113c1f096830fbabdfea586cd3b0f41c5ce4611 (patch)
tree497528b21ba126d9c253e5d1be3276b03a1062cb /src/vyconfd.ml
parent304e4d2a172fe1baf2c1df7f61b7a0a8e40f7d5d (diff)
downloadvyconf-b113c1f096830fbabdfea586cd3b0f41c5ce4611.tar.gz
vyconf-b113c1f096830fbabdfea586cd3b0f41c5ce4611.zip
T7980: use write_internal_atomic for running cache and refactor
Diffstat (limited to 'src/vyconfd.ml')
-rw-r--r--src/vyconfd.ml15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml
index 05cd693..1d270ab 100644
--- a/src/vyconfd.ml
+++ b/src/vyconfd.ml
@@ -274,16 +274,13 @@ let commit world token (req: request_commit) =
let proposed_config = Session.get_proposed_config world s in
let req_dry_run = Option.value req.dry_run ~default:false in
let commit_data =
- Session.prepare_commit
- ~dry_run:req_dry_run
- world
- proposed_config
- token
- s.client_pid
- s.client_sudo_user
- s.client_user
+ Session.prepare_commit ~dry_run:req_dry_run world s proposed_config token
in
- let%lwt received_commit_data = VC.do_commit commit_data in
+ match commit_data with
+ | Error msg ->
+ Lwt.return {response_tmpl with status=Internal_error; error=(Some msg)}
+ | Ok c_data ->
+ let%lwt received_commit_data = VC.do_commit c_data in
let%lwt result_commit_data =
Lwt.return (CC.commit_update received_commit_data)
in