Seems to work now

This commit is contained in:
Ian Roddis
2022-01-12 13:11:55 -04:00
parent 9a5a247f15
commit 868e74fbeb
4 changed files with 29 additions and 36 deletions

View File

@@ -234,7 +234,7 @@ namespace daggy {
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlWriter);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
// curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 3);
if (trace) {
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, http_trace);

View File

@@ -266,6 +266,7 @@ void DaggyRunnerTaskExecutor::monitor()
std::unordered_map<std::string, RunnerCapacity> runners;
while (running_) {
std::this_thread::sleep_for(std::chrono::seconds(2));
std::unordered_map<std::pair<DAGRunID, std::string>,
std::optional<AttemptRecord>>
resolvedJobs;
@@ -302,7 +303,11 @@ void DaggyRunnerTaskExecutor::monitor()
std::cout << "Unable to poll: " << e.what() << std::endl;
continue;
}
std::cout << "Doc is now: " << doc.Size() << std::endl;
if (!doc.IsArray()) {
std::cout << "Got nonsense from poll: " << dumpJSON(doc) << std::endl;
continue;
}
const auto tasks = doc.GetArray();
for (size_t idx = 0; idx < tasks.Size(); ++idx) {
@@ -338,7 +343,5 @@ void DaggyRunnerTaskExecutor::monitor()
runningTasks_.extract(tid);
}
}
std::this_thread::sleep_for(std::chrono::seconds(10));
}
}