Skip to content

Commit

Permalink
XrdApps::JCache: fix logic when to store into the journal or the vector
Browse files Browse the repository at this point in the history
cache
  • Loading branch information
Andreas Joachim Peters committed Jun 10, 2024
1 parent 0e27a6c commit fb8e01f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadVHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public:
pResponse->Get(vReadInfo);
ChunkList* chunks = &(vReadInfo->GetChunks());
// store successfull reads in the journal if there is no vector cache
if (journal) {
if (vcachepath.empty()) {
for (auto it = chunks->begin(); it != chunks->end(); ++it) {
journal->pwrite(it->GetBuffer(), it->GetLength(), it->GetOffset());
}
} else {
VectorCache cache(*chunks, url, (const char*)buffer, vcachepath);
cache.store();
}
if (vcachepath.empty()) {
if (journal) {
for (auto it = chunks->begin(); it != chunks->end(); ++it) {
journal->pwrite(it->GetBuffer(), it->GetLength(), it->GetOffset());
}
}
} else {
VectorCache cache(*chunks, url, (const char*)buffer, vcachepath);
cache.store();
}
for (auto it = chunks->begin(); it != chunks->end(); ++it) {
*rvbytes += it->GetLength();
Expand Down

0 comments on commit fb8e01f

Please sign in to comment.