Skip to content

Commit b74dfd0

Browse files
author
Michal Tichák
committed
ignore warnings variable in objectManager.cxx
1 parent de92710 commit b74dfd0

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

Framework/include/QualityControl/ObjectsManager.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ class ObjectsManager
9393
"you are trying to startPublishing object that is not mergeable."
9494
" If you know what you are doing use startPublishing<true>(...)");
9595
#endif
96-
startPublishingImpl(obj, policy);
96+
startPublishingImpl(obj, policy, IgnoreMergeable);
9797
}
9898

9999
/**
100100
* Stop publishing this object
101101
* @param obj
102102
* @throw ObjectNotFoundError if object is not found.
103103
*/
104-
void
105-
stopPublishing(TObject* obj);
104+
void stopPublishing(TObject* obj);
106105

107106
/**
108107
* Stop publishing this object
@@ -240,7 +239,7 @@ class ObjectsManager
240239
Activity mActivity;
241240
std::vector<std::string> mMovingWindowsList;
242241

243-
void startPublishingImpl(TObject* obj, PublicationPolicy);
242+
void startPublishingImpl(TObject* obj, PublicationPolicy, bool ignoreMergeableWarning);
244243
};
245244

246245
} // namespace o2::quality_control::core

Framework/src/ObjectsManager.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,22 @@ ObjectsManager::~ObjectsManager()
6060
ILOG(Debug, Devel) << "ObjectsManager destructor" << ENDM;
6161
}
6262

63-
void ObjectsManager::startPublishingImpl(TObject* object, PublicationPolicy publicationPolicy)
63+
void ObjectsManager::startPublishingImpl(TObject* object, PublicationPolicy publicationPolicy, bool ignoreMergeableWarning)
6464
{
6565
if (!object) {
6666
ILOG(Warning, Support) << "A nullptr provided to ObjectManager::startPublishing" << ENDM;
6767
return;
6868
}
69+
6970
if (mMonitorObjects->FindObject(object->GetName()) != nullptr) {
7071
ILOG(Warning, Support) << "Object is already being published (" << object->GetName() << "), will remove it and add the new one" << ENDM;
7172
stopPublishing(object->GetName());
7273
}
73-
if (mergers::isMergeable(object)) {
74-
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";
74+
75+
if (!ignoreMergeableWarning && !mergers::isMergeable(object)) {
76+
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;
7577
}
78+
7679
auto* newObject = new MonitorObject(object, mTaskName, mTaskClass, mDetectorName);
7780
newObject->setIsOwner(false);
7881
newObject->setActivity(mActivity);

Framework/src/SliceTrendingTask.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void SliceTrendingTask::generatePlots()
258258
}
259259

260260
mPlots[plot.name] = c;
261-
getObjectsManager()->startPublishing<true>(c, PublicationPolicy::Once);
261+
getObjectsManager()->startPublishing(c, PublicationPolicy::Once);
262262
}
263263
} // void SliceTrendingTask::generatePlots()
264264

Framework/src/TrendingTask.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void TrendingTask::generatePlots()
268268
}
269269
auto c = drawPlot(plotConfig);
270270
mPlots[plotConfig.name].reset(c);
271-
getObjectsManager()->startPublishing<true>(c, PublicationPolicy::Once);
271+
getObjectsManager()->startPublishing(c, PublicationPolicy::Once);
272272
}
273273
}
274274

0 commit comments

Comments
 (0)