diff --git a/libdaggy/src/executors/task/DaggyRunnerTaskExecutor.cpp b/libdaggy/src/executors/task/DaggyRunnerTaskExecutor.cpp index d7a0c1a..c7c3413 100644 --- a/libdaggy/src/executors/task/DaggyRunnerTaskExecutor.cpp +++ b/libdaggy/src/executors/task/DaggyRunnerTaskExecutor.cpp @@ -158,8 +158,9 @@ std::future DaggyRunnerTaskExecutor::execute( std::lock_guard lock(runnersGuard_); for (auto &[runner, caps] : runners_) { const auto result = HTTP_REQUEST(runner + "/ready"); - if (result.code != 200) + if (result.code != 200) { continue; + } // Set capacities if they haven't been discovered yet if (caps.total.cores == 0) { @@ -206,14 +207,16 @@ std::future DaggyRunnerTaskExecutor::execute( const auto response = HTTP_REQUEST(url, taskToJSON(task), "POST"); if (response.code != HTTPCode::Ok) { + std::cout << response.code << " : " << response.body << std::endl; continue; // throw std::runtime_error("Unable to submit task: " + response.body); } submitted_runner = runner; + break; } - if (!submitted_runner.empty()) { + if (submitted_runner.empty()) { std::promise prom; auto fut = prom.get_future(); AttemptRecord record{.rc = -1,