# HG changeset patch # User Sebastien Jodogne # Date 1354888872 -3600 # Node ID e6a4c432948127b9723083e2f941b21125c435ab # Parent f6fdf5abe7515dd19288a1c0bab313fc2a174ec8 parameters for storage capacity diff -r f6fdf5abe751 -r e6a4c4329481 OrthancServer/OrthancInitialization.h --- a/OrthancServer/OrthancInitialization.h Fri Dec 07 14:46:44 2012 +0100 +++ b/OrthancServer/OrthancInitialization.h Fri Dec 07 15:01:12 2012 +0100 @@ -35,6 +35,7 @@ #include #include #include +#include #include "../Core/HttpServer/MongooseServer.h" namespace Orthanc diff -r f6fdf5abe751 -r e6a4c4329481 OrthancServer/ServerIndex.cpp --- a/OrthancServer/ServerIndex.cpp Fri Dec 07 14:46:44 2012 +0100 +++ b/OrthancServer/ServerIndex.cpp Fri Dec 07 15:01:12 2012 +0100 @@ -838,6 +838,16 @@ { boost::mutex::scoped_lock lock(mutex_); maximumPatients_ = count; + + if (count == 0) + { + LOG(WARNING) << "No limit on the number of stored patients"; + } + else + { + LOG(WARNING) << "At most " << count << " patients will be stored"; + } + StandaloneRecycling(); } @@ -845,6 +855,16 @@ { boost::mutex::scoped_lock lock(mutex_); maximumStorageSize_ = size; + + if (size == 0) + { + LOG(WARNING) << "No limit on the size of the storage area"; + } + else + { + LOG(WARNING) << "At most " << (size / (1024 * 1024)) << "MB will be used for the storage area"; + } + StandaloneRecycling(); } diff -r f6fdf5abe751 -r e6a4c4329481 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Fri Dec 07 14:46:44 2012 +0100 +++ b/OrthancServer/main.cpp Fri Dec 07 15:01:12 2012 +0100 @@ -214,6 +214,25 @@ ServerContext context(storageDirectory); context.SetCompressionEnabled(GetGlobalBoolParameter("StorageCompression", false)); + try + { + context.GetIndex().SetMaximumPatientCount(GetGlobalIntegerParameter("MaximumPatientCount", 0)); + } + catch (...) + { + context.GetIndex().SetMaximumPatientCount(0); + } + + try + { + uint64_t size = GetGlobalIntegerParameter("MaximumStorageSize", 0); + context.GetIndex().SetMaximumStorageSize(size * 1024 * 1024); + } + catch (...) + { + context.GetIndex().SetMaximumStorageSize(0); + } + MyDicomStoreFactory storeScp(context); { diff -r f6fdf5abe751 -r e6a4c4329481 Resources/Configuration.json --- a/Resources/Configuration.json Fri Dec 07 14:46:44 2012 +0100 +++ b/Resources/Configuration.json Fri Dec 07 15:01:12 2012 +0100 @@ -13,6 +13,14 @@ // Enable the transparent compression of the DICOM instances "StorageCompression" : false, + // Maximum size of the storage in MB (a value of "0" indicates no + // limit on the storage size) + "MaximumStorageSize" : 0, + + // Maximum number of patients that can be stored at a given time + // in the storage (a value of "0" indicates no limit on the number + // of patients) + "MaximumPatientCount" : 0, /**