Fixing issue building dag with states where states were not properly transfered

This commit is contained in:
Ian Roddis
2022-02-16 14:33:04 -04:00
parent 3866332e77
commit 0ee198e3e7
2 changed files with 4 additions and 15 deletions

View File

@@ -121,7 +121,7 @@ namespace daggy {
void DAG<K, V>::resetRunning()
{
for (auto &v : vertices_) {
if (v.state != +RunState::RUNNING)
if (v.state == +RunState::COMPLETED)
continue;
v.state = RunState::QUEUED;
}

View File

@@ -192,18 +192,7 @@ namespace daggy {
// Replay any updates
for (const auto &[taskName, taskUpdates] : updates) {
for (const auto &update : taskUpdates) {
switch (update.state) {
case RunState::RUNNING:
case RunState::RETRY:
case RunState::PAUSED:
case RunState::ERRORED:
case RunState::KILLED:
dag.setVertexState(taskName, RunState::RUNNING);
break;
case RunState::COMPLETED:
case RunState::QUEUED:
break;
}
dag.setVertexState(taskName, update.state);
}
}
@@ -254,7 +243,6 @@ namespace daggy {
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
curl_easy_cleanup(curl);
response.code = HTTPCode::Server_Error;
response.body = std::string{"CURL Failed: "} + curl_easy_strerror(res);
@@ -263,7 +251,8 @@ namespace daggy {
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response.code);
curl_easy_cleanup(curl);
response.body = buffer.str();
} else {
}
else {
throw std::runtime_error("Unable to init cURL object");
}