Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CCDB/include/CCDB/BasicCCDBManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ T* CCDBManagerInstance::getForTimeStamp(std::string const& path, long timestamp,
}
auto end = std::chrono::system_clock::now();
mTimerMS += std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
auto *ref = o2::framework::ServiceRegistryRef::globalDeviceRef();
auto* ref = o2::framework::ServiceRegistryRef::globalDeviceRef();
if (ref && ref->active<framework::DataProcessingStats>()) {
auto& stats = ref->get<o2::framework::DataProcessingStats>();
stats.updateStats({(int)o2::framework::ProcessingStatsId::CCDB_CACHE_HIT, o2::framework::DataProcessingStats::Op::Set, (int64_t)mQueries - mFailures - mFetches});
Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/include/Framework/ServiceRegistryRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ServiceRegistryRef
mRegistry.unlock(mSalt);
}

static ServiceRegistryRef *globalDeviceRef(ServiceRegistryRef *ref = nullptr);
static ServiceRegistryRef* globalDeviceRef(ServiceRegistryRef* ref = nullptr);

private:
ServiceRegistry& mRegistry;
Expand Down
11 changes: 6 additions & 5 deletions Framework/Core/src/ServiceRegistryRef.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.


#include "Framework/ServiceRegistryRef.h"
namespace o2::framework {
namespace o2::framework
{

ServiceRegistryRef *ServiceRegistryRef::globalDeviceRef(ServiceRegistryRef *ref) {
static ServiceRegistryRef *globalRef = nullptr;
ServiceRegistryRef* ServiceRegistryRef::globalDeviceRef(ServiceRegistryRef* ref)
{
static ServiceRegistryRef* globalRef = nullptr;
if (!globalRef) {
globalRef = ref;
}
// We return a copy, so that it can be cache
return globalRef;
}

}
} // namespace o2::framework