Skip to content

Commit 72430e9

Browse files
authored
Revert "Revert "[QC-429] Propagating the validity through QC chain, but do not use it (#1902)" (#1917)" (#1928)
This reverts commit 09b0e37.
1 parent 418ba8f commit 72430e9

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

Framework/src/AggregatorRunner.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ void AggregatorRunner::store(QualityObjectsType& qualityObjects)
240240
for (auto& qo : qualityObjects) {
241241
mDatabase->storeQO(qo);
242242
}
243+
if (!qualityObjects.empty()) {
244+
auto& qo = qualityObjects.at(0);
245+
ILOG(Info, Devel) << "Validity of QO '" << qo->GetName() << "' is (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
246+
}
243247
} catch (boost::exception& e) {
244248
ILOG(Info, Devel) << "Unable to " << diagnostic_information(e) << ENDM;
245249
}

Framework/src/CcdbDatabase.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ void CcdbDatabase::storeQO(std::shared_ptr<const o2::quality_control::core::Qual
286286
if (to == -1 || to == 0 || validity.getMax() == gInvalidValidityInterval.getMax() || validity.getMax() == gFullValidityInterval.getMax()) {
287287
to = from + 1000l * 60 * 60 * 24 * 365 * 10; // ~10 years since the start of validity
288288
}
289+
289290
if (from >= to) {
290291
ILOG(Error, Support) << "The start validity of '" << qo->GetName() << "' is not earlier than the end (" << from << ", " << to << "). The object will not be stored" << ENDM;
291292
return;

Framework/src/CheckRunner.cxx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,18 @@ void CheckRunner::store(QualityObjectsType& qualityObjects, long validFrom)
379379
ILOG(Debug, Devel) << "Storing " << qualityObjects.size() << " QualityObjects" << ENDM;
380380
try {
381381
for (auto& qo : qualityObjects) {
382-
qo->setActivity(*mActivity);
383-
qo->getActivity().mValidity.set(validFrom, 0);
382+
auto tmpValidity = qo->getValidity();
383+
qo->setValidity(ValidityInterval{ static_cast<unsigned long>(validFrom), validFrom + 10ull * 365 * 24 * 60 * 60 * 1000 });
384384
mDatabase->storeQO(qo);
385+
qo->setValidity(tmpValidity);
385386
mTotalNumberQOStored++;
386387
mNumberQOStored++;
387388
}
389+
390+
if (!qualityObjects.empty()) {
391+
auto& qo = qualityObjects.at(0);
392+
ILOG(Info, Devel) << "New validity of QO '" << qo->GetName() << "' would be (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
393+
}
388394
} catch (boost::exception& e) {
389395
ILOG(Info, Support) << "Unable to " << diagnostic_information(e) << ENDM;
390396
}
@@ -395,12 +401,17 @@ void CheckRunner::store(std::vector<std::shared_ptr<MonitorObject>>& monitorObje
395401
ILOG(Debug, Devel) << "Storing " << monitorObjects.size() << " MonitorObjects" << ENDM;
396402
try {
397403
for (auto& mo : monitorObjects) {
398-
mo->setActivity(*mActivity);
399-
mo->getActivity().mValidity.set(validFrom, 0);
404+
auto tmpValidity = mo->getValidity();
405+
mo->setValidity(ValidityInterval{ static_cast<unsigned long>(validFrom), validFrom + 10ull * 365 * 24 * 60 * 60 * 1000 });
400406
mDatabase->storeMO(mo);
407+
mo->setValidity(tmpValidity);
401408
mTotalNumberMOStored++;
402409
mNumberMOStored++;
403410
}
411+
if (!monitorObjects.empty()) {
412+
auto& mo = monitorObjects.at(0);
413+
ILOG(Info, Devel) << "New validity of MO '" << mo->GetName() << "' would be (" << mo->getValidity().getMin() << ", " << mo->getValidity().getMax() << ")" << ENDM;
414+
}
404415
} catch (boost::exception& e) {
405416
ILOG(Info, Support) << "Unable to " << diagnostic_information(e) << ENDM;
406417
}

Framework/src/TaskRunner.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void TaskRunner::finishCycle(DataAllocator& outputs)
496496

497497
// this stays until we move to using mTimekeeper.
498498
auto nowMs = getCurrentTimestamp();
499-
mObjectsManager->setValidity(ValidityInterval{ nowMs, nowMs + 1000l * 60 * 60 * 24 * 365 * 10 });
499+
mObjectsManager->setValidity(mTimekeeper->getValidity());
500500
mNumberObjectsPublishedInCycle += publish(outputs);
501501
mTotalNumberObjectsPublished += mNumberObjectsPublishedInCycle;
502502
saveToFile();

0 commit comments

Comments
 (0)