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_);
|
std::lock_guard<std::mutex> lock(runnersGuard_);
|
||||||
for (auto &[runner, caps] : runners_) {
|
for (auto &[runner, caps] : runners_) {
|
||||||
const auto result = HTTP_REQUEST(runner + "/ready");
|
const auto result = HTTP_REQUEST(runner + "/ready");
|
||||||
if (result.code != 200)
|
if (result.code != 200) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Set capacities if they haven't been discovered yet
|
// Set capacities if they haven't been discovered yet
|
||||||
if (caps.total.cores == 0) {
|
if (caps.total.cores == 0) {
|
||||||
@@ -206,14 +207,16 @@ std::future<AttemptRecord> DaggyRunnerTaskExecutor::execute(
|
|||||||
|
|
||||||
const auto response = HTTP_REQUEST(url, taskToJSON(task), "POST");
|
const auto response = HTTP_REQUEST(url, taskToJSON(task), "POST");
|
||||||
if (response.code != HTTPCode::Ok) {
|
if (response.code != HTTPCode::Ok) {
|
||||||
|
std::cout << response.code << " : " << response.body << std::endl;
|
||||||
continue;
|
continue;
|
||||||
// throw std::runtime_error("Unable to submit task: " + response.body);
|
// throw std::runtime_error("Unable to submit task: " + response.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
submitted_runner = runner;
|
submitted_runner = runner;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!submitted_runner.empty()) {
|
if (submitted_runner.empty()) {
|
||||||
std::promise<AttemptRecord> prom;
|
std::promise<AttemptRecord> prom;
|
||||||
auto fut = prom.get_future();
|
auto fut = prom.get_future();
|
||||||
AttemptRecord record{.rc = -1,
|
AttemptRecord record{.rc = -1,
|
||||||
|
|||||||
Reference in New Issue
Block a user