Making task endpoint a bit more useful, including state changes and attempts
This commit is contained in:
@@ -541,16 +541,15 @@ namespace daggy::daggyd {
|
||||
auto runID = request.param(":runID").as<DAGRunID>();
|
||||
auto taskName = request.param(":taskName").as<std::string>();
|
||||
|
||||
std::stringstream ss;
|
||||
Task task;
|
||||
try {
|
||||
task = logger_.getTask(runID, taskName);
|
||||
auto taskRecord = logger_.getTaskRecord(runID, taskName);
|
||||
std::stringstream ss;
|
||||
ss << taskRecordToJSON(taskRecord) << '\n';
|
||||
response.send(Pistache::Http::Code::Ok, ss.str());
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
REQ_RESPONSE(Not_Found, e.what());
|
||||
}
|
||||
ss << taskToJSON(task);
|
||||
response.send(Pistache::Http::Code::Ok, ss.str());
|
||||
}
|
||||
|
||||
void Server::handleStopTask(const Pistache::Rest::Request &request,
|
||||
|
||||
Reference in New Issue
Block a user