Skip to content

Commit

Permalink
Partially updated get/put/post for CompoundJob/Action methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukaryo-heilscher committed Apr 8, 2024
1 parent 916a446 commit f186079
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/wrench/wrench-daemon/doc/wrench-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2824,7 +2824,7 @@
}
},
"/simulation/{simid}/compoundJobs/{compound_job_name}/addComputeAction": {
"get": {
"post": {
"tags": [
"WRENCH"
],
Expand Down
9 changes: 5 additions & 4 deletions tools/wrench/wrench-daemon/src/SimulationController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,16 +1199,17 @@ json SimulationController::addSleepAction(json data) {
std::string child_compound_job_name = data["compound_job"];
std::string parent_compound_job_name = data["parent_compound_job"];

std::shared_ptr<CompoundJob> compound_job;
std::shared_ptr<CompoundJob> parent_compound_job;
std::shared_ptr<CompoundJob> child_compound_job;

if (not this->compound_job_registry.lookup(parent_compound_job_name, compound_job)) {
if (not this->compound_job_registry.lookup(parent_compound_job_name, parent_compound_job)) {
throw std::runtime_error("Unknown compound job " + parent_compound_job_name);
}
if (not this->compound_job_registry.lookup(child_compound_job_name, compound_job)) {
if (not this->compound_job_registry.lookup(child_compound_job_name, child_compound_job)) {
throw std::runtime_error("Unknown compound job " + child_compound_job_name);
}

child_compound_job_name->addParentJob(parent_compound_job_name);
child_compound_job->addParentJob(parent_compound_job);
return;
}

Expand Down

0 comments on commit f186079

Please sign in to comment.