Skip to content

Commit

Permalink
Merge pull request 'Add few Lwt.pause to give an opportunity for othe…
Browse files Browse the repository at this point in the history
…r processes to run' (#32) from pause into main

Reviewed-on: https://git.robur.coop/robur/git-kv/pulls/32
  • Loading branch information
dinosaure committed Feb 12, 2024
2 parents 08a8a8a + 0832c0f commit 948dfd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/git_kv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ let pack t ?(level= 4) ~commit stream =
go encoder
| `End -> Lwt.return_unit in
let encoder = Carton.Enc.N.dst encoder b.o 0 (Bigstringaf.length b.o) in
go encoder in
Lwt.pause () >>= fun () -> go encoder in
let rec go idx =
if idx < Array.length targets
then encode_target idx >>= fun () -> go (succ idx)
else Lwt.return_unit in
else Lwt.pause () in
go 0 >>= fun () ->
let hash = SHA1.get !ctx in
stream (Some (SHA1.to_raw_string hash)) ;
Expand Down

0 comments on commit 948dfd8

Please sign in to comment.