diff Framework/Oracle/GenericOracleRunner.cpp @ 1140:6333e6f7248e broker

fix cache
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 Nov 2019 16:53:15 +0100
parents cc029987b6dc
children 5e164c629923
line wrap: on
line diff
--- a/Framework/Oracle/GenericOracleRunner.cpp	Thu Nov 07 09:16:31 2019 +0100
+++ b/Framework/Oracle/GenericOracleRunner.cpp	Thu Nov 07 16:53:15 2019 +0100
@@ -261,6 +261,10 @@
           throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentFile);
         }
 
+        LOG(TRACE) << "Parsing DICOM file, " 
+                   << (command.IsPixelDataIncluded() ? "with" : "witout")
+                   << " pixel data: " << path;
+
         uint64_t fileSize = Orthanc::SystemToolbox::GetFileSize(path);
 
         // Check for 32bit systems
@@ -293,8 +297,6 @@
 #endif
         }
 
-        printf("Reading %s\n", path.c_str());
-
         if (ok)
         {
           handler.Handle(new Orthanc::ParsedDicomFile(dicom), command, path, fileSize);
@@ -372,6 +374,11 @@
 
         // Store it into the cache for future use
         assert(cache_);
+
+        // Invalidate to overwrite DICOM instance that would already
+        // be stored without pixel data
+        cache_->Invalidate(path);
+
         cache_->Acquire(path, parsed.release(),
                         static_cast<size_t>(fileSize), command.IsPixelDataIncluded());
       }