Mercurial > hg > orthanc
changeset 6816:581eb569f39a streaming
removed ServerContext::dicomCache_
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Tue, 19 May 2026 18:18:24 +0200 |
| parents | f29bf471d4a5 |
| children | 0ffaef5500c1 |
| files | OrthancServer/Sources/ServerContext.cpp OrthancServer/Sources/ServerContext.h |
| diffstat | 2 files changed, 9 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerContext.cpp Tue May 19 18:11:31 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Tue May 19 18:18:24 2026 +0200 @@ -361,10 +361,14 @@ void ServerContext::PublishCacheMetrics() { - metricsRegistry_->SetFloatValue("orthanc_dicom_cache_size_mb", - static_cast<float>(dicomCache_.GetCurrentSize()) / static_cast<float>(1024 * 1024)); - metricsRegistry_->SetIntegerValue("orthanc_dicom_cache_count", - static_cast<int64_t>(dicomCache_.GetNumberOfItems())); + // TODO-Streaming + + //metricsRegistry_->SetFloatValue("orthanc_dicom_cache_size_mb", + //static_cast<float>(dicomCache_.GetCurrentSize()) / static_cast<float>(1024 * 1024)); + //metricsRegistry_->SetIntegerValue("orthanc_dicom_cache_count", + //static_cast<int64_t>(dicomCache_.GetNumberOfItems())); + + metricsRegistry_->SetFloatValue("orthanc_storage_cache_size_mb", static_cast<float>(storageCache_.GetCurrentSize()) / static_cast<float>(1024 * 1024)); metricsRegistry_->SetIntegerValue("orthanc_storage_cache_count", @@ -382,7 +386,6 @@ compressionEnabled_(false), storeMD5_(true), largeDicomThrottler_(1), - dicomCache_(DICOM_CACHE_SIZE), mainLua_(*this), filterLua_(*this), luaListener_(*this), @@ -560,7 +563,7 @@ pool->Start(); storageAreaReader_.reset(new DataSourceReader(pool.release(), new StorageAreaDataSource(area_))); - storageAreaReader_->CreateCache(256 * 1024 * 1024); // 256 MB - TODO-Streaming - Parameter + storageAreaReader_->CreateCache(DICOM_CACHE_SIZE); // TODO-Streaming - Parameter } { @@ -823,12 +826,6 @@ return result; } - // Remove the file from the DicomCache - // If this is a new instance, this is a no-op - // If overwriteMode == OverwriteInstancesMode_IfChanged and the file has not changed, we won't reach this point - // If overwriteMode == OverwriteInstancesMode_Always, then, let's always invalidate even if it is meaningful only if the file has changed (note: there is a TODO about cache and MD5) - dicomCache_.Invalidate(resultPublicId); - // TODO Should we use "gzip" instead? CompressionType compression = (compressionEnabled_ ? CompressionType_ZlibWithSize : CompressionType_None); @@ -1615,24 +1612,12 @@ const std::string& uuid, ResourceType expectedType) { - if (expectedType == ResourceType_Instance) - { - // remove the file from the DicomCache - dicomCache_.Invalidate(uuid); - } - return index_.DeleteResource(remainingAncestor, uuid, expectedType); } void ServerContext::SignalChange(const ServerIndexChange& change) { - if (change.GetResourceType() == ResourceType_Instance && - change.GetChangeType() == ChangeType_Deleted) - { - dicomCache_.Invalidate(change.GetPublicId()); - } - pendingChanges_.Enqueue(change.Clone()); }
--- a/OrthancServer/Sources/ServerContext.h Tue May 19 18:11:31 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.h Tue May 19 18:18:24 2026 +0200 @@ -33,7 +33,6 @@ #include "../../OrthancFramework/Sources/DataSource/DataSourceReader.h" #include "../../OrthancFramework/Sources/DataSource/DicomDataSource.h" #include "../../OrthancFramework/Sources/DicomParsing/DicomModification.h" -#include "../../OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h" #include "../../OrthancFramework/Sources/FileStorage/StorageAccessor.h" #include "../../OrthancFramework/Sources/FileStorage/StorageCache.h" #include "../../OrthancFramework/Sources/JobsEngine/JobsEngine.h" @@ -202,7 +201,6 @@ bool storeMD5_; Semaphore largeDicomThrottler_; // New in Orthanc 1.9.0 (notably for very large DICOM files in WSI) - ParsedDicomCache dicomCache_; LuaScripting mainLua_; LuaScripting filterLua_;
