comparison OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp @ 2624:714dcddeb65f jobs

asynchronous c-movoe
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 May 2018 21:44:22 +0200
parents 988936118354
children c691fcf66071
comparison
equal deleted inserted replaced
2623:bd6e0b70e915 2624:714dcddeb65f
50 } 50 }
51 51
52 LOG(INFO) << "Sending instance " << instance << " to peer \"" 52 LOG(INFO) << "Sending instance " << instance << " to peer \""
53 << peer_.GetUrl() << "\""; 53 << peer_.GetUrl() << "\"";
54 54
55 context_.ReadDicom(client_->GetBody(), instance); 55 try
56 {
57 context_.ReadDicom(client_->GetBody(), instance);
58 }
59 catch (OrthancException& e)
60 {
61 LOG(WARNING) << "An instance was removed after the job was issued: " << instance;
62 return false;
63 }
56 64
57 std::string answer; 65 std::string answer;
58 if (client_->Apply(answer)) 66 if (client_->Apply(answer))
59 { 67 {
60 return true; 68 return true;
88 void OrthancPeerStoreJob::GetPublicContent(Json::Value& value) 96 void OrthancPeerStoreJob::GetPublicContent(Json::Value& value)
89 { 97 {
90 Json::Value v; 98 Json::Value v;
91 peer_.ToJson(v); 99 peer_.ToJson(v);
92 value["Peer"] = v; 100 value["Peer"] = v;
93 101
102 value["Description"] = GetDescription();
94 value["InstancesCount"] = static_cast<uint32_t>(GetInstances().size()); 103 value["InstancesCount"] = static_cast<uint32_t>(GetInstances().size());
95 value["FailedInstancesCount"] = static_cast<uint32_t>(GetFailedInstances().size()); 104 value["FailedInstancesCount"] = static_cast<uint32_t>(GetFailedInstances().size());
96 } 105 }
97 } 106 }