scheduler: fix WSL plan class

admin web: fix bug in opening DB
This commit is contained in:
David Anderson 2024-09-04 21:27:13 -07:00
parent 0f9fe79ff3
commit 242786b6c0
3 changed files with 8 additions and 5 deletions

View File

@ -108,7 +108,7 @@ class BoincDb {
if (self::$dbnum == $dbnum) { if (self::$dbnum == $dbnum) {
return self::$instance; return self::$instance;
} }
close(); self::close();
} }
if (web_stopped()) { if (web_stopped()) {
if ($generating_xml) { if ($generating_xml) {

View File

@ -22,9 +22,9 @@
$cli_only = true; $cli_only = true;
require_once("../inc/util_ops.inc"); require_once("../inc/util_ops.inc");
$db = BoincDb::get_aux(false); $db = BoincDb::get(0);
if (!$db) { if (!$db) {
echo "Can't open database\n"; echo "db_update.php: Can't open database\n";
exit; exit;
} }

View File

@ -157,6 +157,8 @@ static bool wu_is_infeasible_for_plan_class(
return false; return false;
} }
// parse plan_class_spec.xml
//
int PLAN_CLASS_SPECS::parse_file(const char* path) { int PLAN_CLASS_SPECS::parse_file(const char* path) {
FILE* f = boinc::fopen(path, "r"); FILE* f = boinc::fopen(path, "r");
if (!f) return ERR_FOPEN; if (!f) return ERR_FOPEN;
@ -544,7 +546,7 @@ bool PLAN_CLASS_SPEC::check(
} }
if (wsl) { if (wsl) {
if (!sreq.host.wsl_available) { if (sreq.host.wsl_distros.distros.empty()) {
add_no_work_message("WSL is not available on this host"); add_no_work_message("WSL is not available on this host");
return false; return false;
} }
@ -1106,6 +1108,7 @@ int PLAN_CLASS_SPEC::parse(XML_PARSER& xp) {
if (xp.parse_bool("cal", cal)) continue; if (xp.parse_bool("cal", cal)) continue;
if (xp.parse_bool("opencl", opencl)) continue; if (xp.parse_bool("opencl", opencl)) continue;
if (xp.parse_bool("virtualbox", virtualbox)) continue; if (xp.parse_bool("virtualbox", virtualbox)) continue;
if (xp.parse_bool("wsl", wsl)) continue;
if (xp.parse_bool("is64bit", is64bit)) continue; if (xp.parse_bool("is64bit", is64bit)) continue;
if (xp.parse_str("cpu_feature", buf, sizeof(buf))) { if (xp.parse_str("cpu_feature", buf, sizeof(buf))) {
cpu_features.push_back(" " + (string)buf + " "); cpu_features.push_back(" " + (string)buf + " ");
@ -1244,7 +1247,6 @@ int PLAN_CLASS_SPECS::parse_specs(FILE* f) {
return ERR_XML_PARSE; return ERR_XML_PARSE;
} }
PLAN_CLASS_SPEC::PLAN_CLASS_SPEC() { PLAN_CLASS_SPEC::PLAN_CLASS_SPEC() {
strcpy(name, ""); strcpy(name, "");
strcpy(gpu_type, ""); strcpy(gpu_type, "");
@ -1252,6 +1254,7 @@ PLAN_CLASS_SPEC::PLAN_CLASS_SPEC() {
cal = false; cal = false;
opencl = false; opencl = false;
virtualbox = false; virtualbox = false;
wsl = false;
is64bit = false; is64bit = false;
min_ncpus = 0; min_ncpus = 0;
max_threads = 1; max_threads = 1;