comparison Core/JobsEngine/JobsEngine.cpp @ 2950:dc18d5804746

support of JobsHistorySize set to zero
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 30 Nov 2018 17:19:57 +0100
parents ea7aea6f6a95
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2949:e6204cd21443 2950:dc18d5804746
154 } 154 }
155 } 155 }
156 } 156 }
157 157
158 158
159 JobsEngine::JobsEngine() : 159 JobsEngine::JobsEngine(size_t maxCompletedJobs) :
160 state_(State_Setup), 160 state_(State_Setup),
161 registry_(new JobsRegistry), 161 registry_(new JobsRegistry(maxCompletedJobs)),
162 threadSleep_(200), 162 threadSleep_(200),
163 workers_(1) 163 workers_(1)
164 { 164 {
165 } 165 }
166 166
196 { 196 {
197 // Can only be invoked before calling "Start()" 197 // Can only be invoked before calling "Start()"
198 throw OrthancException(ErrorCode_BadSequenceOfCalls); 198 throw OrthancException(ErrorCode_BadSequenceOfCalls);
199 } 199 }
200 200
201 registry_.reset(new JobsRegistry(unserializer, serialized)); 201 assert(registry_.get() != NULL);
202 const size_t maxCompletedJobs = registry_->GetMaxCompletedJobs();
203 registry_.reset(new JobsRegistry(unserializer, serialized, maxCompletedJobs));
202 } 204 }
203 205
204 206
205 void JobsEngine::LoadRegistryFromString(IJobUnserializer& unserializer, 207 void JobsEngine::LoadRegistryFromString(IJobUnserializer& unserializer,
206 const std::string& serialized) 208 const std::string& serialized)