Skip to content

Commit

Permalink
Use unsafe isCachedObjectValid with CheckObjValidityEnabled
Browse files Browse the repository at this point in the history
If the ccdbManager.setLocalObjectValidityChecking() was set, then the method
ccdbManager.isCachedObjectValid(path, timestamp)
will use only cached object (if any) SOV and EOV to check its validity.
By defaults the timestamp of cache filling and Cache-Valid-Until timestamp
accounting for the possible overlap of objects validity
  • Loading branch information
shahor02 committed Mar 6, 2024
1 parent 6db13a9 commit fe41d60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CCDB/include/CCDB/BasicCCDBManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ class CCDBManagerInstance
if (!isCachingEnabled()) {
return false;
}
return mCache[path].isCacheValid(timestamp); // use stricter check
// return mCache[path].isValid(timestamp);
return (mCheckObjValidityEnabled && mCache[path].isValid(timestamp)) || mCache[path].isCacheValid(timestamp); // use stricter check
}

/// check if checks of object validity before CCDB query is enabled
Expand Down Expand Up @@ -264,6 +263,7 @@ T* CCDBManagerInstance::getForTimeStamp(std::string const& path, long timestamp)
cached.objPtr.reset(ptr);
}
cached.uuid = mHeaders["ETag"];

try {
if (mHeaders.find("Valid-From") != mHeaders.end()) {
cached.startvalidity = std::stol(mHeaders["Valid-From"]);
Expand Down

0 comments on commit fe41d60

Please sign in to comment.