Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion Detectors/MUON/MCH/Conditions/src/bad-channels-ccdb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ std::set<uint64_t> listTSWhenBadChannelsChange(const std::string ccdbUrl, const
std::string currentETag{};
for (auto itTS = tsChanges.begin(); itTS != tsChanges.end();) {
auto headers = api.retrieveHeaders(source, metadata, *itTS);
if (headers["ETag"] == currentETag) {
if (headers["ETag"].empty()) {
std::cout << "- Warning: missing file" << std::endl;
auto validUntil = (std::next(itTS) != tsChanges.end()) ? *std::next(itTS) : endTimestamp;
std::cout << fmt::format(" validity range: {} - {}\n", *itTS, validUntil);
++itTS;
} else if (headers["ETag"] == currentETag) {
itTS = tsChanges.erase(itTS);
} else {
if (verbose) {
Expand Down Expand Up @@ -129,6 +134,19 @@ BadChannelsVector queryBadChannels(const std::string ccdbUrl,
std::map<std::string, std::string> metadata;
auto source = ccdbPath(badChannelType);
auto* badChannels = api.retrieveFromTFileAny<BadChannelsVector>(source, metadata, timestamp);
if (badChannels == nullptr) {
std::cout << "do you want to proceed anyway? [y/n] ";
std::string response{};
while (true) {
std::cin >> response;
if (response == "y") {
std::cout << "number of bad channels = 0" << std::endl;
return {};
} else if (response == "n") {
exit(3);
}
}
}
std::cout << "number of bad channels = " << badChannels->size() << std::endl;
if (verbose) {
for (const auto& badChannel : *badChannels) {
Expand Down