# HG changeset patch # User Sebastien Jodogne # Date 1480107467 -3600 # Node ID f2c179294382c4f891ef955575622f62dd782446 # Parent d529d9ce3c7e0526bdea959237cbc539fd42e8d1 improvement diff -r d529d9ce3c7e -r f2c179294382 Framework/Inputs/DicomPyramidInstance.cpp --- a/Framework/Inputs/DicomPyramidInstance.cpp Fri Nov 25 21:56:07 2016 +0100 +++ b/Framework/Inputs/DicomPyramidInstance.cpp Fri Nov 25 21:57:47 2016 +0100 @@ -213,16 +213,20 @@ } catch (Orthanc::OrthancException&) { + // No cached information yet } } - // No cached information, compute it from scratch + // Compute information about this instance from scratch Load(orthanc, instanceId); - // Serialize the computed information and cache it as a metadata - std::string serialized, tmp; - Serialize(serialized); - orthanc.RestApiPut(tmp, "/instances/" + instanceId + "/metadata/" + SERIALIZED_METADATA, serialized); + if (useCache) + { + // Serialize the computed information and cache it as a metadata + std::string serialized, tmp; + Serialize(serialized); + orthanc.RestApiPut(tmp, "/instances/" + instanceId + "/metadata/" + SERIALIZED_METADATA, serialized); + } }