Limit the number of concurrent downloads
At the moment this is hardcoded to 20 concurrent downloads.
This commit is contained in:
parent
236e09b7e0
commit
030e6d8ab7
1 changed files with 2 additions and 0 deletions
|
@ -369,7 +369,9 @@ module Make
|
||||||
Logs.info (fun m -> m "git: %s" msg);
|
Logs.info (fun m -> m "git: %s" msg);
|
||||||
Git.find_urls store >>= fun urls ->
|
Git.find_urls store >>= fun urls ->
|
||||||
Disk.init kv >>= fun disk ->
|
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_list.iter_p (fun (url, csums) ->
|
||||||
|
Lwt_pool.use pool @@ fun () ->
|
||||||
HM.fold (fun h v r ->
|
HM.fold (fun h v r ->
|
||||||
r >>= function
|
r >>= function
|
||||||
| true -> Disk.exists disk h (hex_to_string v)
|
| true -> Disk.exists disk h (hex_to_string v)
|
||||||
|
|
Loading…
Reference in a new issue