package sihl

  1. Overview
  2. Docs
The Sihl web framework

Install

Dune Dependency

Authors

Maintainers

Sources

3.0.0.tar.gz
md5=3ceaa839d4d9480011761257aedf2f22
sha512=6b44bb6f67b1933a7b74fff8488d3cc6c9a7360fa99b3aeae9158e2887dbc44c1b215d8cffb6cc082cc88a0ffa576b2d9ebdd21850f2a19656aedbe4c0fe2c59

doc/src/sihl/core_cleaner.ml.html

Source file core_cleaner.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
let registered_cleaners
    : (?ctx:(string * string) list -> unit -> unit Lwt.t) list ref
  =
  ref []
;;

let register_cleaner cleaner =
  registered_cleaners := List.cons cleaner !registered_cleaners
;;

let register_cleaners cleaners =
  registered_cleaners := List.concat [ !registered_cleaners; cleaners ]
;;

let clean_all ?ctx () =
  let cleaners = !registered_cleaners in
  let rec clean_repos ?ctx cleaners =
    match cleaners with
    | [] -> Lwt.return ()
    | cleaner :: cleaners ->
      let%lwt () = cleaner ?ctx () in
      clean_repos cleaners
  in
  clean_repos ?ctx cleaners
;;
OCaml

Innovation. Community. Security.