From fb8e01fd214b8946b08bc1c6fd95cf6f61881f11 Mon Sep 17 00:00:00 2001 From: Andreas Joachim Peters Date: Mon, 10 Jun 2024 14:12:59 +0200 Subject: [PATCH] XrdApps::JCache: fix logic when to store into the journal or the vector cache --- .../handler/XrdClJCacheReadVHandler.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadVHandler.hh b/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadVHandler.hh index f94e9ceb65c..59552d03bdb 100644 --- a/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadVHandler.hh +++ b/src/XrdApps/XrdClJCachePlugin/handler/XrdClJCacheReadVHandler.hh @@ -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();