# HG changeset patch # User Alain Mazy # Date 1783328146 -7200 # Node ID 936dd64d8f7b8b10dbaea0c90b75c0f26f6e7594 # Parent 64a0500e449f658d2bcb92ab7d48de7b44e38b5e cleanup TODO-streaming: checkMD5 + StorageCacheSize diff -r 64a0500e449f -r 936dd64d8f7b OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Mon Jul 06 10:31:20 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Mon Jul 06 10:55:46 2026 +0200 @@ -550,8 +550,6 @@ { try { - bool checkMD5 = true; - { OrthancConfiguration::ReaderLock lock; @@ -677,8 +675,6 @@ SetAcceptedSopClasses(acceptedSopClasses, rejectedSopClasses); defaultDicomRetrieveMethod_ = StringToRetrieveMethod(lock.GetConfiguration().GetDicomDefaultRetrieveMethod()); - - checkMD5 = lock.GetConfiguration().GetBooleanParameter("CheckMD5", true); // TODO-Streaming - Parameter } jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); @@ -755,7 +751,7 @@ pool->SetMetricsConfiguration(*metricsRegistry_, METRICS_STORAGE_THREAD_POOL_AVAILABLE_THREADS); pool->Start(); - std::unique_ptr source(new StorageAreaDataSource(area_, checkMD5)); + std::unique_ptr source(new StorageAreaDataSource(area_, IsStoreMD5ForAttachments())); source->SetMetricsRegistry(metricsRegistry_, METRICS_STORAGE_AREA_READ_BYTES, METRICS_STORAGE_AREA_READ_DURATION); @@ -773,6 +769,15 @@ storageAreaReader_->SetCapacity(storageMemoryCapacityMb * MEGABYTE); storageAreaReader_->CreateCache(storageCacheSizeMb * MEGABYTE); + + if (storageCacheSizeMb == 0) + { + LOG(WARNING) << "Storage cache is disabled"; + } + else + { + LOG(WARNING) << "Storage cache size is " << storageCacheSizeMb << " MB"; + } } { diff -r 64a0500e449f -r 936dd64d8f7b OrthancServer/Sources/ServerContext.h --- a/OrthancServer/Sources/ServerContext.h Mon Jul 06 10:31:20 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.h Mon Jul 06 10:55:46 2026 +0200 @@ -322,11 +322,6 @@ return index_; } - void SetMaximumStorageCacheSize(size_t size) - { - // TODO-Streaming - } - void SetPatientLevelEnabled(bool enabled); bool IsPatientLevelEnabled() const @@ -369,7 +364,7 @@ StoreResult TranscodeAndStore(std::string& resultPublicId, DicomInstanceToStore* dicom, - bool isReconstruct = false); // TODO-Streaming: To check + bool isReconstruct = false); void AnswerAttachment(RestApiOutput& output, const FileInfo& fileInfo, diff -r 64a0500e449f -r 936dd64d8f7b OrthancServer/Sources/main.cpp --- a/OrthancServer/Sources/main.cpp Mon Jul 06 10:31:20 2026 +0200 +++ b/OrthancServer/Sources/main.cpp Mon Jul 06 10:55:46 2026 +0200 @@ -1789,26 +1789,6 @@ context.GetIndex().SetMaximumStorageMode(MaxStorageMode_Recycle); } } - - // note: this config is valid in ReadOnlyMode - try - { - uint64_t size = lock.GetConfiguration().GetMaximumStorageCacheSize(); - if (size == 0) - { - LOG(WARNING) << "Storage cache is disabled"; - } - else - { - LOG(WARNING) << "Storage cache size is " << size << " MB"; - } - - context.SetMaximumStorageCacheSize(size * 1024 * 1024); - } - catch (...) - { - context.SetMaximumStorageCacheSize(128); - } } {