Fix: -compute-method not set when configuration file present (#268)

This commit is contained in:
Luis Uguina
2020-06-21 02:31:31 +10:00
committed by GitHub
parent 7685051662
commit 608e1d7aea
2 changed files with 26 additions and 21 deletions

View File

@@ -361,9 +361,15 @@ public class SettingsLoader {
config.setUsePriority(priority);
}
try {
if ((config.getComputeMethod() == null && computeMethod != null) || (computeMethod != null && config.getComputeMethod() != ComputeType
if (config.getComputeMethod() == null && computeMethod == null) {
config.setComputeMethod(ComputeType.CPU);
}
else if ((config.getComputeMethod() == null && computeMethod != null) || (computeMethod != null && config.getComputeMethod() != ComputeType
.valueOf(computeMethod))) {
config.setComputeMethod(ComputeType.valueOf(computeMethod));
if (config.getComputeMethod() == null) {
config.setComputeMethod(ComputeType.valueOf(computeMethod));
}
}
}
catch (IllegalArgumentException e) {