Adding simple defaults for rest_server for testing
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
// Add loggers here
|
||||
#include <daggy/loggers/dag_run/OStreamLogger.hpp>
|
||||
#include <daggy/loggers/dag_run/FileSystemLogger.hpp>
|
||||
|
||||
struct Options {
|
||||
std::string listenIP = "localhost";
|
||||
@@ -22,6 +21,7 @@ struct Options {
|
||||
};
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
/*
|
||||
Options options;
|
||||
|
||||
argparse::ArgumentParser args("Daggy");
|
||||
@@ -34,13 +34,18 @@ int main(int argc, char **argv) {
|
||||
args.add_argument("--port")
|
||||
.help("Port to listen to")
|
||||
.action([](const std::string &value) { return std::stoi(value); });
|
||||
*/
|
||||
|
||||
std::ofstream logFile(options.logFile, std::ios::app);
|
||||
std::ofstream logFile("daggy.log", std::ios::app);
|
||||
daggy::loggers::dag_run::OStreamLogger logger(logFile);
|
||||
daggy::executors::task::ForkingTaskExecutor executor(options.taskThreads);
|
||||
Pistache::Address listenSpec(options.listenIP, options.listenPort);
|
||||
daggy::executors::task::ForkingTaskExecutor executor(32);
|
||||
Pistache::Address listenSpec("localhost", 2503);
|
||||
|
||||
daggy::Server server(listenSpec, logger, executor, options.dagThreads);
|
||||
server.init(options.webThreads);
|
||||
daggy::Server server(listenSpec, logger, executor, 25);
|
||||
server.init(25);
|
||||
server.start();
|
||||
}
|
||||
std::cout << "Server running at http://localhost:2503, Ctrl-C to exit" << std::endl;
|
||||
while (true) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(30));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user