Simplifying daggyr server, and returning to a
task submit / task poll model. Squashed commit of the following: commit 0ef57f095d15f0402915de54f83c1671120bd228 Author: Ian Roddis <tech@kinesin.ca> Date: Wed Feb 2 08:18:03 2022 -0400 Simplifying task polling and reducing lock scopes commit d77ef02021cc728849c7d1fb0185dd1a861b4a3d Author: Ian Roddis <tech@kinesin.ca> Date: Wed Feb 2 08:02:47 2022 -0400 Simplifying check commit c1acf34440162abb890a959f3685c2d184242ed5 Author: Ian Roddis <tech@kinesin.ca> Date: Wed Feb 2 08:01:13 2022 -0400 Removing capacity tracking from runner, since it is maintained in daggyd commit 9401246f92113ab140143c1895978b9de8bd9972 Author: Ian Roddis <tech@kinesin.ca> Date: Wed Feb 2 07:47:28 2022 -0400 Adding retry for submission commit 398aa04a320347bb35f23f3f101d91ab4df25652 Author: Ian Roddis <tech@kinesin.ca> Date: Tue Feb 1 14:54:20 2022 -0400 Adding in execution note, as well as requeuing the result if the peer disconnects commit 637b14af6d5b53f25b9c38d4c8a7ed8532af5599 Author: Ian Roddis <tech@kinesin.ca> Date: Tue Feb 1 14:13:59 2022 -0400 Fixing locking issues commit 4d6716dfda8aa7f51e0abbdab833aff618915ba0 Author: Ian Roddis <tech@kinesin.ca> Date: Tue Feb 1 13:33:14 2022 -0400 Single task daggyr working commit bd48a5452a92817faf25ee44a6115aaa2f6c30d1 Author: Ian Roddis <tech@kinesin.ca> Date: Tue Feb 1 12:22:04 2022 -0400 Checkpointing work
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, 20);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 3);
|
||||
|
||||
if (trace) {
|
||||
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, http_trace);
|
||||
@@ -276,16 +276,20 @@ namespace daggy {
|
||||
auto response = HTTP_REQUEST(url, payload, method);
|
||||
|
||||
rj::Document doc;
|
||||
try {
|
||||
checkRJParse(doc.Parse(response.body.c_str()));
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
doc.SetObject();
|
||||
auto &alloc = doc.GetAllocator();
|
||||
std::string message = (response.body.empty() ? e.what() : response.body);
|
||||
doc.AddMember(
|
||||
"error",
|
||||
rj::Value().SetString(message.c_str(), message.size(), alloc), alloc);
|
||||
if (!response.body.empty()) {
|
||||
try {
|
||||
checkRJParse(doc.Parse(response.body.c_str()));
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
doc.SetObject();
|
||||
auto &alloc = doc.GetAllocator();
|
||||
std::string message =
|
||||
(response.body.empty() ? e.what() : response.body);
|
||||
doc.AddMember(
|
||||
"error",
|
||||
rj::Value().SetString(message.c_str(), message.size(), alloc),
|
||||
alloc);
|
||||
}
|
||||
}
|
||||
|
||||
return std::make_pair(response.code, std::move(doc));
|
||||
|
||||
Reference in New Issue
Block a user