Mercurial > hg > orthanc
comparison OrthancServer/ServerContext.cpp @ 2940:4767d36679ed
refactoring access to Orthanc configuration
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Nov 2018 11:47:00 +0100 |
parents | a80ba85d89e6 |
children | dc18d5804746 |
comparison
equal
deleted
inserted
replaced
2939:577786f59252 | 2940:4767d36679ed |
---|---|
38 #include "../Core/FileStorage/StorageAccessor.h" | 38 #include "../Core/FileStorage/StorageAccessor.h" |
39 #include "../Core/HttpServer/FilesystemHttpSender.h" | 39 #include "../Core/HttpServer/FilesystemHttpSender.h" |
40 #include "../Core/HttpServer/HttpStreamTranscoder.h" | 40 #include "../Core/HttpServer/HttpStreamTranscoder.h" |
41 #include "../Core/Logging.h" | 41 #include "../Core/Logging.h" |
42 #include "../Plugins/Engine/OrthancPlugins.h" | 42 #include "../Plugins/Engine/OrthancPlugins.h" |
43 #include "OrthancInitialization.h" | 43 #include "OrthancConfiguration.h" |
44 #include "OrthancRestApi/OrthancRestApi.h" | 44 #include "OrthancRestApi/OrthancRestApi.h" |
45 #include "Search/LookupResource.h" | 45 #include "Search/LookupResource.h" |
46 #include "ServerJobs/OrthancJobUnserializer.h" | 46 #include "ServerJobs/OrthancJobUnserializer.h" |
47 #include "ServerToolbox.h" | 47 #include "ServerToolbox.h" |
48 | 48 |
227 #if ORTHANC_ENABLE_PLUGINS == 1 | 227 #if ORTHANC_ENABLE_PLUGINS == 1 |
228 plugins_(NULL), | 228 plugins_(NULL), |
229 #endif | 229 #endif |
230 done_(false), | 230 done_(false), |
231 haveJobsChanged_(false), | 231 haveJobsChanged_(false), |
232 isJobsEngineUnserialized_(false), | 232 isJobsEngineUnserialized_(false) |
233 queryRetrieveArchive_(Configuration::GetGlobalUnsignedIntegerParameter("QueryRetrieveSize", 10)), | 233 { |
234 defaultLocalAet_(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")) | 234 { |
235 { | 235 OrthancConfiguration::ReaderLock lock; |
236 jobsEngine_.SetWorkersCount(Configuration::GetGlobalUnsignedIntegerParameter("ConcurrentJobs", 2)); | 236 queryRetrieveArchive_.reset( |
237 new SharedArchive(lock.GetConfiguration().GetUnsignedIntegerParameter("QueryRetrieveSize", 10))); | |
238 defaultLocalAet_ = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC"); | |
239 jobsEngine_.SetWorkersCount(lock.GetConfiguration().GetUnsignedIntegerParameter("ConcurrentJobs", 2)); | |
240 } | |
241 | |
237 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); | 242 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); |
238 | 243 |
239 listeners_.push_back(ServerListener(luaListener_, "Lua")); | 244 listeners_.push_back(ServerListener(luaListener_, "Lua")); |
240 changeThread_ = boost::thread(ChangeThread, this, (unitTesting ? 20 : 100)); | 245 changeThread_ = boost::thread(ChangeThread, this, (unitTesting ? 20 : 100)); |
241 } | 246 } |
817 it = instances.begin(); it != instances.end(); ++it) | 822 it = instances.begin(); it != instances.end(); ++it) |
818 { | 823 { |
819 job.AddInstance(*it); | 824 job.AddInstance(*it); |
820 } | 825 } |
821 } | 826 } |
827 | |
828 | |
829 void ServerContext::SignalUpdatedModalities() | |
830 { | |
831 #if ORTHANC_ENABLE_PLUGINS == 1 | |
832 if (HasPlugins()) | |
833 { | |
834 GetPlugins().SignalUpdatedModalities(); | |
835 } | |
836 #endif | |
837 } | |
838 | |
839 | |
840 void ServerContext::SignalUpdatedPeers() | |
841 { | |
842 #if ORTHANC_ENABLE_PLUGINS == 1 | |
843 if (HasPlugins()) | |
844 { | |
845 GetPlugins().SignalUpdatedPeers(); | |
846 } | |
847 #endif | |
848 } | |
822 } | 849 } |