@@ -82,6 +82,9 @@ pub struct CliMirror {
82
82
/// Run oma in "dry-run" mode. Useful for testing changes and operations without making changes to the system
83
83
#[ arg( from_global) ]
84
84
dry_run : bool ,
85
+ /// Setup download threads (default as 4)
86
+ #[ arg( from_global) ]
87
+ download_threads : Option < usize > ,
85
88
}
86
89
87
90
#[ derive( Debug , Subcommand ) ]
@@ -161,6 +164,7 @@ impl CliExecuter for CliMirror {
161
164
no_refresh_topics,
162
165
no_refresh,
163
166
dry_run,
167
+ download_threads,
164
168
} = self ;
165
169
166
170
if dry_run {
@@ -178,7 +182,7 @@ impl CliExecuter for CliMirror {
178
182
} => operate (
179
183
no_progress,
180
184
!no_refresh_topics && !config. no_refresh_topics ( ) ,
181
- config. network_thread ( ) ,
185
+ download_threads . unwrap_or_else ( || config. network_thread ( ) ) ,
182
186
no_refresh,
183
187
names. iter ( ) . map ( |x| x. as_str ( ) ) . collect :: < Vec < _ > > ( ) ,
184
188
sysroot,
@@ -193,7 +197,7 @@ impl CliExecuter for CliMirror {
193
197
no_progress,
194
198
set_fastest,
195
199
!no_refresh_topics && !config. no_refresh_topics ( ) ,
196
- config. network_thread ( ) ,
200
+ download_threads . unwrap_or_else ( || config. network_thread ( ) ) ,
197
201
no_refresh,
198
202
) ,
199
203
MirrorSubCmd :: Add {
@@ -204,7 +208,7 @@ impl CliExecuter for CliMirror {
204
208
} => operate (
205
209
no_progress,
206
210
!no_refresh_topics && !config. no_refresh_topics ( ) ,
207
- config. network_thread ( ) ,
211
+ download_threads . unwrap_or_else ( || config. network_thread ( ) ) ,
208
212
no_refresh,
209
213
names. iter ( ) . map ( |x| x. as_str ( ) ) . collect :: < Vec < _ > > ( ) ,
210
214
sysroot,
@@ -218,7 +222,7 @@ impl CliExecuter for CliMirror {
218
222
} => operate (
219
223
no_progress,
220
224
!no_refresh_topics && !config. no_refresh_topics ( ) ,
221
- config. network_thread ( ) ,
225
+ download_threads . unwrap_or_else ( || config. network_thread ( ) ) ,
222
226
no_refresh,
223
227
names. iter ( ) . map ( |x| x. as_str ( ) ) . collect :: < Vec < _ > > ( ) ,
224
228
sysroot,
@@ -230,15 +234,15 @@ impl CliExecuter for CliMirror {
230
234
} => set_order (
231
235
no_progress,
232
236
!no_refresh_topics && !config. no_refresh_topics ( ) ,
233
- config. network_thread ( ) ,
237
+ download_threads . unwrap_or_else ( || config. network_thread ( ) ) ,
234
238
no_refresh,
235
239
) ,
236
240
}
237
241
} else {
238
242
tui (
239
243
no_progress,
240
244
!no_refresh_topics && !config. no_refresh_topics ( ) ,
241
- config. network_thread ( ) ,
245
+ download_threads . unwrap_or_else ( || config. network_thread ( ) ) ,
242
246
no_refresh,
243
247
)
244
248
}
0 commit comments