From 0832c0fde9c32d0a37e64b393258d672f2b43f47 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Sun, 11 Feb 2024 12:35:57 +0100 Subject: [PATCH] Add few Lwt.pause to give an opportunity for other processes to run --- src/git_kv.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git_kv.ml b/src/git_kv.ml index d46fec2..691a89a 100644 --- a/src/git_kv.ml +++ b/src/git_kv.ml @@ -243,11 +243,11 @@ let pack t ~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)) ;