Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
1139:8d2f1b25593c | 1140:6333e6f7248e |
---|---|
259 if (!Orthanc::SystemToolbox::IsRegularFile(path)) | 259 if (!Orthanc::SystemToolbox::IsRegularFile(path)) |
260 { | 260 { |
261 throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentFile); | 261 throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentFile); |
262 } | 262 } |
263 | 263 |
264 LOG(TRACE) << "Parsing DICOM file, " | |
265 << (command.IsPixelDataIncluded() ? "with" : "witout") | |
266 << " pixel data: " << path; | |
267 | |
264 uint64_t fileSize = Orthanc::SystemToolbox::GetFileSize(path); | 268 uint64_t fileSize = Orthanc::SystemToolbox::GetFileSize(path); |
265 | 269 |
266 // Check for 32bit systems | 270 // Check for 32bit systems |
267 if (fileSize != static_cast<uint64_t>(static_cast<size_t>(fileSize))) | 271 if (fileSize != static_cast<uint64_t>(static_cast<size_t>(fileSize))) |
268 { | 272 { |
290 #else | 294 #else |
291 // The primitive "loadFileUntilTag" was introduced in DCMTK 3.6.2 | 295 // The primitive "loadFileUntilTag" was introduced in DCMTK 3.6.2 |
292 ok = dicom.loadFile(path.c_str()).good(); | 296 ok = dicom.loadFile(path.c_str()).good(); |
293 #endif | 297 #endif |
294 } | 298 } |
295 | |
296 printf("Reading %s\n", path.c_str()); | |
297 | 299 |
298 if (ok) | 300 if (ok) |
299 { | 301 { |
300 handler.Handle(new Orthanc::ParsedDicomFile(dicom), command, path, fileSize); | 302 handler.Handle(new Orthanc::ParsedDicomFile(dicom), command, path, fileSize); |
301 } | 303 } |
370 emitter_.EmitMessage(receiver_, message); | 372 emitter_.EmitMessage(receiver_, message); |
371 } | 373 } |
372 | 374 |
373 // Store it into the cache for future use | 375 // Store it into the cache for future use |
374 assert(cache_); | 376 assert(cache_); |
377 | |
378 // Invalidate to overwrite DICOM instance that would already | |
379 // be stored without pixel data | |
380 cache_->Invalidate(path); | |
381 | |
375 cache_->Acquire(path, parsed.release(), | 382 cache_->Acquire(path, parsed.release(), |
376 static_cast<size_t>(fileSize), command.IsPixelDataIncluded()); | 383 static_cast<size_t>(fileSize), command.IsPixelDataIncluded()); |
377 } | 384 } |
378 }; | 385 }; |
379 } | 386 } |