Merge pull request 'Limit the number of concurrent downloads' (#4) from download-pool into main
Reviewed-on: https://git.robur.io/robur/opam-mirror/pulls/4
This commit is contained in:
commit
bf29496274
1 changed files with 2 additions and 0 deletions
|
@ -369,7 +369,9 @@ module Make
|
|||
Logs.info (fun m -> m "git: %s" msg);
|
||||
Git.find_urls store >>= fun urls ->
|
||||
Disk.init kv >>= fun disk ->
|
||||
let pool = Lwt_pool.create 20 (Fun.const Lwt.return_unit) in
|
||||
Lwt_list.iter_p (fun (url, csums) ->
|
||||
Lwt_pool.use pool @@ fun () ->
|
||||
HM.fold (fun h v r ->
|
||||
r >>= function
|
||||
| true -> Disk.exists disk h (hex_to_string v)
|
||||
|
|
Loading…
Reference in a new issue