- Fixing issue with parameter expansion on DAG submission to server
- Adding sections to unit_server tests - Adding cleanup
This commit is contained in:
@@ -101,13 +101,6 @@ namespace daggy {
|
||||
if (!doc.HasMember("tasks")) { REQ_ERROR(Bad_Request, "DAG Run has no tasks."); }
|
||||
|
||||
std::string runName = doc["name"].GetString();
|
||||
std::vector<Task> tasks;
|
||||
try {
|
||||
auto parsedTasks = tasksFromJSON(doc["tasks"].GetArray());
|
||||
tasks.swap(parsedTasks);
|
||||
} catch (std::exception &e) {
|
||||
REQ_ERROR(Bad_Request, e.what());
|
||||
}
|
||||
|
||||
// Get parameters if there are any
|
||||
ParameterValues parameters;
|
||||
@@ -120,6 +113,16 @@ namespace daggy {
|
||||
}
|
||||
}
|
||||
|
||||
// Get the tasks
|
||||
std::vector<Task> tasks;
|
||||
try {
|
||||
auto parsedTasks = tasksFromJSON(doc["tasks"].GetArray(), parameters);
|
||||
tasks.swap(parsedTasks);
|
||||
} catch (std::exception &e) {
|
||||
REQ_ERROR(Bad_Request, e.what());
|
||||
}
|
||||
|
||||
|
||||
// Get a run ID
|
||||
auto runID = logger_.startDAGRun(runName, tasks);
|
||||
auto dag = buildDAGFromTasks(tasks);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <iterator>
|
||||
|
||||
#include <magic_enum.hpp>
|
||||
|
||||
#include <daggy/loggers/dag_run/OStreamLogger.hpp>
|
||||
@@ -13,6 +15,11 @@ namespace daggy {
|
||||
size_t runID = nextRunID_++;
|
||||
os_ << "Starting new DAGRun named " << name << " with ID " << runID << " and " << tasks.size()
|
||||
<< " tasks" << std::endl;
|
||||
for (const auto &task : tasks) {
|
||||
os_ << "TASK (" << task.name << "): ";
|
||||
std::copy(task.command.begin(), task.command.end(), std::ostream_iterator<std::string>(os_, " "));
|
||||
os_ << std::endl;
|
||||
}
|
||||
return runID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user