Skip to content

Commit

Permalink
ignore warnings variable in objectManager.cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák committed Nov 21, 2024
1 parent de92710 commit ece6f89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Framework/include/QualityControl/ObjectsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ObjectsManager
"you are trying to startPublishing object that is not mergeable."
" If you know what you are doing use startPublishing<true>(...)");
#endif
startPublishingImpl(obj, policy);
startPublishingImpl(obj, policy, IgnoreMergeable);
}

/**
Expand Down Expand Up @@ -240,7 +240,7 @@ class ObjectsManager
Activity mActivity;
std::vector<std::string> mMovingWindowsList;

void startPublishingImpl(TObject* obj, PublicationPolicy);
void startPublishingImpl(TObject* obj, PublicationPolicy, bool ignoreMergeableWarning);
};

} // namespace o2::quality_control::core
Expand Down
9 changes: 6 additions & 3 deletions Framework/src/ObjectsManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,22 @@ ObjectsManager::~ObjectsManager()
ILOG(Debug, Devel) << "ObjectsManager destructor" << ENDM;
}

void ObjectsManager::startPublishingImpl(TObject* object, PublicationPolicy publicationPolicy)
void ObjectsManager::startPublishingImpl(TObject* object, PublicationPolicy publicationPolicy, bool ignoreMergeableWarning)
{
if (!object) {
ILOG(Warning, Support) << "A nullptr provided to ObjectManager::startPublishing" << ENDM;
return;
}

if (mMonitorObjects->FindObject(object->GetName()) != nullptr) {
ILOG(Warning, Support) << "Object is already being published (" << object->GetName() << "), will remove it and add the new one" << ENDM;
stopPublishing(object->GetName());
}
if (mergers::isMergeable(object)) {
ILOG(Warning, Support) << "Object '" + std::string(object->GetName()) + "' with type '" + std::string(object->ClassName()) + "' is not one of the mergeable types, it might cause issues during publishing";

if (!ignoreMergeableWarning && !mergers::isMergeable(object)) {
ILOG(Warning, Support) << "Object '" + std::string(object->GetName()) + "' with type '" + std::string(object->ClassName()) + "' is not one of the mergeable types, it will not be correctly merged in distributed setups, such as P2 and Grid" << ENDM;
}

auto* newObject = new MonitorObject(object, mTaskName, mTaskClass, mDetectorName);
newObject->setIsOwner(false);
newObject->setActivity(mActivity);
Expand Down

0 comments on commit ece6f89

Please sign in to comment.