Compare commits
No commits in common. "abd7e24b5e5613b3009ccf35f29934ed12f8cd8f" and "b93e2978b0239ad8704d0a27d8b651a766d7641a" have entirely different histories.
abd7e24b5e
...
b93e2978b0
@ -26,7 +26,6 @@
|
|||||||
#include "rpc/common.hpp"
|
#include "rpc/common.hpp"
|
||||||
#include "types/repertory.hpp"
|
#include "types/repertory.hpp"
|
||||||
#include "ui/mgmt_app_config.hpp"
|
#include "ui/mgmt_app_config.hpp"
|
||||||
#include "utils/common.hpp"
|
|
||||||
#include "utils/error_utils.hpp"
|
#include "utils/error_utils.hpp"
|
||||||
#include "utils/file.hpp"
|
#include "utils/file.hpp"
|
||||||
#include "utils/path.hpp"
|
#include "utils/path.hpp"
|
||||||
@ -113,6 +112,8 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server)
|
|||||||
handle_put_set_value_by_name(req, res);
|
handle_put_set_value_by_name(req, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
event_system::instance().start();
|
||||||
|
|
||||||
static std::atomic<httplib::Server *> this_server{server_};
|
static std::atomic<httplib::Server *> this_server{server_};
|
||||||
static const auto quit_handler = [](int /* sig */) {
|
static const auto quit_handler = [](int /* sig */) {
|
||||||
auto *ptr = this_server.load();
|
auto *ptr = this_server.load();
|
||||||
@ -143,21 +144,6 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server)
|
|||||||
build fails here
|
build fails here
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::uint16_t port{};
|
|
||||||
if (not utils::get_next_available_port(config_->get_api_port(), port)) {
|
|
||||||
fmt::println("failed to detect if port is available|{}",
|
|
||||||
config_->get_api_port());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (port != config_->get_api_port()) {
|
|
||||||
fmt::println("failed to listen on port|{}|next available|{}",
|
|
||||||
config_->get_api_port(), port);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
event_system::instance().start();
|
|
||||||
|
|
||||||
server_->listen("127.0.0.1", config_->get_api_port());
|
server_->listen("127.0.0.1", config_->get_api_port());
|
||||||
this_server = nullptr;
|
this_server = nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user