Skip to content

Commit f46641f

Browse files
committed
Allow non-fatal execution of missing/wrongly spelled ConfigKey params
1 parent 72efd78 commit f46641f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Common/Utils/src/ConfigurableParam.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ void ConfigurableParam::setValues(std::vector<std::pair<std::string, std::string
509509
return el.size() > 0 && (el.at(0) == '[') && (el.at(el.size() - 1) == ']');
510510
};
511511

512+
bool nonFatal = getenv("ALICEO2_CONFIGURABLEPARAM_WRONGKEYISNONFATAL") != nullptr;
513+
512514
// Take a vector of param key/value pairs
513515
// and update the storage map for each of them by calling setValue.
514516
// 1. For string/scalar types this is simple.
@@ -521,6 +523,10 @@ void ConfigurableParam::setValues(std::vector<std::pair<std::string, std::string
521523
std::string value = o2::utils::Str::trim_copy(keyValue.second);
522524

523525
if (!keyInTree(sPtree, key)) {
526+
if (nonFatal) {
527+
LOG(warn) << "Ignoring non-existent ConfigurableParam key: " << key;
528+
continue;
529+
}
524530
LOG(fatal) << "Inexistant ConfigurableParam key: " << key;
525531
}
526532

0 commit comments

Comments
 (0)