comparison Core/JobsEngine/JobsRegistry.cpp @ 2652:a3f0f61a14ca jobs

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Jun 2018 12:36:24 +0200
parents e1893d31652a
children c196d76cb8fa
comparison
equal deleted inserted replaced
2651:1da5a052c777 2652:a3f0f61a14ca
264 lastStateChangeTime_(boost::posix_time::microsec_clock::universal_time()), 264 lastStateChangeTime_(boost::posix_time::microsec_clock::universal_time()),
265 pauseScheduled_(false), 265 pauseScheduled_(false),
266 cancelScheduled_(false) 266 cancelScheduled_(false)
267 { 267 {
268 state_ = StringToJobState(IJobUnserializer::GetString(serialized, "State")); 268 state_ = StringToJobState(IJobUnserializer::GetString(serialized, "State"));
269 jobType_ = IJobUnserializer::GetString(serialized, "Type");
270 priority_ = IJobUnserializer::GetInteger(serialized, "Priority"); 269 priority_ = IJobUnserializer::GetInteger(serialized, "Priority");
271 creationTime_ = boost::posix_time::from_iso_string 270 creationTime_ = boost::posix_time::from_iso_string
272 (IJobUnserializer::GetString(serialized, "CreationTime")); 271 (IJobUnserializer::GetString(serialized, "CreationTime"));
273 runtime_ = boost::posix_time::milliseconds(IJobUnserializer::GetInteger(serialized, "Runtime")); 272 runtime_ = boost::posix_time::milliseconds(IJobUnserializer::GetInteger(serialized, "Runtime"));
274 273
278 state_ == JobState_Running) 277 state_ == JobState_Running)
279 { 278 {
280 state_ = JobState_Pending; 279 state_ = JobState_Pending;
281 } 280 }
282 281
283 job_.reset(unserializer.UnserializeJob(jobType_, serialized["Job"])); 282 job_.reset(unserializer.UnserializeJob(serialized["Job"]));
284 283 job_->GetJobType(jobType_);
285 std::string s;
286 job_->GetJobType(s);
287 if (s != jobType_)
288 {
289 throw OrthancException(ErrorCode_InternalError);
290 }
291
292 job_->Start(); 284 job_->Start();
285
293 lastStatus_ = JobStatus(ErrorCode_Success, *job_); 286 lastStatus_ = JobStatus(ErrorCode_Success, *job_);
294 } 287 }
295 }; 288 };
296 289
297 290