comparison OrthancServer/ServerContext.cpp @ 2665:389d050a2e66 jobs

fix deadlock, speed up unit tests
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 08 Jun 2018 13:51:31 +0200
parents e09021ddc00d
children d26dd081df97
comparison
equal deleted inserted replaced
2664:a21b244efb37 2665:389d050a2e66
105 } 105 }
106 } 106 }
107 107
108 108
109 ServerContext::ServerContext(IDatabaseWrapper& database, 109 ServerContext::ServerContext(IDatabaseWrapper& database,
110 IStorageArea& area) : 110 IStorageArea& area,
111 index_(*this, database), 111 bool unitTesting) :
112 index_(*this, database, (unitTesting ? 20 : 500)),
112 area_(area), 113 area_(area),
113 compressionEnabled_(false), 114 compressionEnabled_(false),
114 storeMD5_(true), 115 storeMD5_(true),
115 provider_(*this), 116 provider_(*this),
116 dicomCache_(provider_, DICOM_CACHE_SIZE), 117 dicomCache_(provider_, DICOM_CACHE_SIZE),
124 { 125 {
125 listeners_.push_back(ServerListener(lua_, "Lua")); 126 listeners_.push_back(ServerListener(lua_, "Lua"));
126 127
127 jobsEngine_.SetWorkersCount(Configuration::GetGlobalUnsignedIntegerParameter("ConcurrentJobs", 2)); 128 jobsEngine_.SetWorkersCount(Configuration::GetGlobalUnsignedIntegerParameter("ConcurrentJobs", 2));
128 //jobsEngine_.SetMaxCompleted // TODO 129 //jobsEngine_.SetMaxCompleted // TODO
130 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200);
129 jobsEngine_.Start(); 131 jobsEngine_.Start();
130 132
131 changeThread_ = boost::thread(ChangeThread, this); 133 changeThread_ = boost::thread(ChangeThread, this);
132 } 134 }
133 135