Commit 5f5ec19
fix(downloads): honor the RUSTUP_CONCURRENT_DOWNLOADS by always having "n" concurrent downloads
Using this environment variable with a value between 2 and 5 would mean
that concurrency was not being totally maximized as there could be less
than n futures running at a some point in time.
See:
https://docs.rs/futures-util/0.3.31/futures_util/stream/trait.StreamExt.html#method.buffered
Adding a semaphore allows US to control how many futures are running at
a time, fixing this problem and ensuring that the env var is always
honored and the downloads are maximizing concurrency.1 parent 2d429e8 commit 5f5ec19
2 files changed
+31
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
799 | 801 | | |
800 | 802 | | |
801 | 803 | | |
802 | | - | |
| 804 | + | |
| 805 | + | |
803 | 806 | | |
804 | 807 | | |
805 | 808 | | |
806 | 809 | | |
807 | 810 | | |
808 | 811 | | |
| 812 | + | |
809 | 813 | | |
810 | 814 | | |
811 | 815 | | |
| |||
815 | 819 | | |
816 | 820 | | |
817 | 821 | | |
| 822 | + | |
| 823 | + | |
818 | 824 | | |
| 825 | + | |
819 | 826 | | |
820 | 827 | | |
821 | 828 | | |
| |||
867 | 874 | | |
868 | 875 | | |
869 | 876 | | |
870 | | - | |
| 877 | + | |
871 | 878 | | |
872 | 879 | | |
873 | 880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
160 | | - | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
196 | | - | |
| 205 | + | |
197 | 206 | | |
198 | 207 | | |
199 | 208 | | |
| |||
0 commit comments