Seems to work now
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user