diff --git a/libdaggy/include/daggy/DAG.impl.hxx b/libdaggy/include/daggy/DAG.impl.hxx index 2a9e33c..29e795d 100644 --- a/libdaggy/include/daggy/DAG.impl.hxx +++ b/libdaggy/include/daggy/DAG.impl.hxx @@ -121,7 +121,7 @@ namespace daggy { void DAG::resetRunning() { for (auto &v : vertices_) { - if (v.state != +RunState::RUNNING) + if (v.state == +RunState::COMPLETED) continue; v.state = RunState::QUEUED; } diff --git a/libdaggy/src/Utilities.cpp b/libdaggy/src/Utilities.cpp index 494e993..f562b4e 100644 --- a/libdaggy/src/Utilities.cpp +++ b/libdaggy/src/Utilities.cpp @@ -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"); }