summaryrefslogtreecommitdiff
path: root/src/vyconf_client.ml
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2025-01-20 19:15:10 +0000
committerGitHub <noreply@github.com>2025-01-20 19:15:10 +0000
commita375860a302a224722d254c31a1cb210cb12d972 (patch)
tree96217a1eaf38c910e183c30f2adab865b409e916 /src/vyconf_client.ml
parent5ae7f4150091efb66c6f9946df81adde3ddc6ace (diff)
parent5cb1952f52a8a67905a9361364a0c0823d44ed03 (diff)
downloadvyconf-a375860a302a224722d254c31a1cb210cb12d972.tar.gz
vyconf-a375860a302a224722d254c31a1cb210cb12d972.zip
Merge pull request #13 from jestabro/mutable-world
T7046: T6946: add ability to reload reference tree at runtime
Diffstat (limited to 'src/vyconf_client.ml')
-rw-r--r--src/vyconf_client.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vyconf_client.ml b/src/vyconf_client.ml
index 94348b2..5437428 100644
--- a/src/vyconf_client.ml
+++ b/src/vyconf_client.ml
@@ -117,3 +117,12 @@ let validate client path =
| Success -> Lwt.return (Ok "")
| Fail -> Error (Option.value resp.error ~default:"") |> Lwt.return
| _ -> Error (Option.value resp.error ~default:"") |> Lwt.return
+
+let reload_reftree ?(on_behalf_of=None) client =
+ let id = on_behalf_of |> (function None -> None | Some x -> (Some (Int32.of_int x))) in
+ let req = Reload_reftree {on_behalf_of=id} in
+ let%lwt resp = do_request client req in
+ match resp.status with
+ | Success -> Ok "" |> Lwt.return
+ | Fail -> Error (Option.value resp.error ~default:"") |> Lwt.return
+ | _ -> Error (Option.value resp.error ~default:"") |> Lwt.return