Merge pull request 'Add few Lwt.pause to give an opportunity for other processes to run' (#32) from pause into main
Reviewed-on: #32
This commit is contained in:
commit
948dfd81ba
1 changed files with 2 additions and 2 deletions
|
@ -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)) ;
|
||||
|
|
Loading…
Reference in a new issue