Fixing issue building dag with states where states were not properly transfered
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user