mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-18 08:16:58 -04:00
fix: crash when concurrency is negative.
This commit is contained in:
parent
1b539ade9d
commit
543238be4b
@ -297,6 +297,7 @@ public abstract class FetchTask<T> extends Task<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setDownloadExecutorConcurrency(int concurrency) {
|
public static void setDownloadExecutorConcurrency(int concurrency) {
|
||||||
|
concurrency = Math.max(concurrency, 1);
|
||||||
synchronized (Schedulers.class) {
|
synchronized (Schedulers.class) {
|
||||||
downloadExecutorConcurrency = concurrency;
|
downloadExecutorConcurrency = concurrency;
|
||||||
if (DOWNLOAD_EXECUTOR != null) {
|
if (DOWNLOAD_EXECUTOR != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user