Fixing issue with logic for daggyr submission
This commit is contained in:
@@ -158,8 +158,9 @@ std::future<AttemptRecord> DaggyRunnerTaskExecutor::execute(
|
||||
std::lock_guard<std::mutex> 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<AttemptRecord> 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<AttemptRecord> prom;
|
||||
auto fut = prom.get_future();
|
||||
AttemptRecord record{.rc = -1,
|
||||
|
||||
Reference in New Issue
Block a user