Lots of fixes to poor daggyr implementation, added debugging messages

This commit is contained in:
Ian Roddis
2021-12-21 16:49:45 -04:00
parent 505ffb02bd
commit d90f49b2bb
6 changed files with 142 additions and 106 deletions

View File

@@ -159,6 +159,8 @@ namespace daggy::daggyr {
.resourcesUsed = resourcesUsed});
}
std::cout << "Enqueued " << runID << " / " << taskName << std::endl;
response.send(Pistache::Http::Code::Ok, "");
}
@@ -175,6 +177,7 @@ namespace daggy::daggyr {
std::string payload;
// Check to see if it's pending
bool found = false;
{
std::lock_guard<std::mutex> lock(pendingGuard_);
@@ -193,11 +196,13 @@ namespace daggy::daggyr {
curCapacity_.cores += it->second.resourcesUsed.cores;
curCapacity_.memoryMB += it->second.resourcesUsed.memoryMB;
}
std::cout << "Resolved " << it->first.first << " / "
<< it->first.second << std::endl;
}
else {
payload = R"({ "state": "RUNNING" })";
found = true;
}
}
else {
payload = R"({ "state": "RUNNING" })";
found = true;
}
}
@@ -211,6 +216,7 @@ namespace daggy::daggyr {
payload = R"({ "state": "COMPLETED", "attempt": )" +
attemptRecordToJSON(it->second) + "}";
}
response.send(Pistache::Http::Code::Ok, payload);
}