comparison OrthancServer/ServerContext.cpp @ 4022:a2e4edc7b9aa more-changes

wip: adding job changes
author Alain Mazy <alain@mazy.be>
date Tue, 09 Jun 2020 08:46:52 +0200
parents e42f5445d20d
children 1d2b31fc782f
comparison
equal deleted inserted replaced
4013:1e9f6d706237 4022:a2e4edc7b9aa
188 else 188 else
189 { 189 {
190 LOG(INFO) << "Not reloading the jobs from the last execution of Orthanc"; 190 LOG(INFO) << "Not reloading the jobs from the last execution of Orthanc";
191 } 191 }
192 192
193 jobsEngine_.GetRegistry().SetObserver(*this); 193 jobsEngine_.GetRegistry().AddObserver(*this);
194 jobsEngine_.Start(); 194 jobsEngine_.Start();
195 isJobsEngineUnserialized_ = true; 195 isJobsEngineUnserialized_ = true;
196 196
197 saveJobsThread_ = boost::thread(SaveJobsThread, this, (unitTesting ? 20 : 100)); 197 saveJobsThread_ = boost::thread(SaveJobsThread, this, (unitTesting ? 20 : 100));
198 } 198 }
345 if (saveJobsThread_.joinable()) 345 if (saveJobsThread_.joinable())
346 { 346 {
347 saveJobsThread_.join(); 347 saveJobsThread_.join();
348 } 348 }
349 349
350 jobsEngine_.GetRegistry().ResetObserver(); 350 jobsEngine_.GetRegistry().ResetObserver(*this);
351 351
352 if (isJobsEngineUnserialized_) 352 if (isJobsEngineUnserialized_)
353 { 353 {
354 // Avoid losing jobs if the JobsRegistry cannot be unserialized 354 // Avoid losing jobs if the JobsRegistry cannot be unserialized
355 SaveJobsEngine(); 355 SaveJobsEngine();