diff options
| author | Rutger Broekhoff | 2026-08-28 22:22:24 +0200 |
|---|---|---|
| committer | Rutger Broekhoff | 2026-08-28 22:22:24 +0200 |
| commit | b0d7600970d2fdb1eb6fff813c7336ea34d4e228 (patch) | |
| tree | 051d6f80c7e332f4b31027025ae7c60c7ac70742 /server/src/main.cpp | |
| parent | 70643a9e4821bd11c3f363f1708fe420965467d1 (diff) | |
| download | routemon-b0d7600970d2fdb1eb6fff813c7336ea34d4e228.tar.gz routemon-b0d7600970d2fdb1eb6fff813c7336ea34d4e228.zip | |
Indent tweaks
Diffstat (limited to 'server/src/main.cpp')
| -rw-r--r-- | server/src/main.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/server/src/main.cpp b/server/src/main.cpp index 2957808..3f8cb11 100644 --- a/server/src/main.cpp +++ b/server/src/main.cpp | |||
| @@ -21,9 +21,9 @@ auto real_main(std::span<char const*> args) -> exit_status | |||
| 21 | if (args.size() != 2) | 21 | if (args.size() != 2) |
| 22 | { | 22 | { |
| 23 | l.error( | 23 | l.error( |
| 24 | "Fatal: expected exactly one argument (the configuration file " | 24 | "Fatal: expected exactly one argument (the configuration file " |
| 25 | "location), got {}", | 25 | "location), got {}", |
| 26 | args.size() - 1); | 26 | args.size() - 1); |
| 27 | return exit_status::bad_usage; | 27 | return exit_status::bad_usage; |
| 28 | } | 28 | } |
| 29 | auto const* config_filename = args[1]; | 29 | auto const* config_filename = args[1]; |
| @@ -48,7 +48,7 @@ auto real_main(std::span<char const*> args) -> exit_status | |||
| 48 | catch (std::exception const& e) | 48 | catch (std::exception const& e) |
| 49 | { | 49 | { |
| 50 | l.with("filename", std::string_view{config_filename}) | 50 | l.with("filename", std::string_view{config_filename}) |
| 51 | .error("Failed to load configuration: {}", e.what()); | 51 | .error("Failed to load configuration: {}", e.what()); |
| 52 | return exit_status::failure; | 52 | return exit_status::failure; |
| 53 | } | 53 | } |
| 54 | sink->set_level(config.logger.level); | 54 | sink->set_level(config.logger.level); |
| @@ -68,19 +68,19 @@ auto real_main(std::span<char const*> args) -> exit_status | |||
| 68 | catch (std::exception const& e) | 68 | catch (std::exception const& e) |
| 69 | { | 69 | { |
| 70 | l.with("filename", config.database.sqlite3_filename) | 70 | l.with("filename", config.database.sqlite3_filename) |
| 71 | .error("Failed to open database: {}", e.what()); | 71 | .error("Failed to open database: {}", e.what()); |
| 72 | return exit_status::failure; | 72 | return exit_status::failure; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | l.with("filename", config.situations.datex2_filename) | 75 | l.with("filename", config.situations.datex2_filename) |
| 76 | .info("Loading situations"); | 76 | .info("Loading situations"); |
| 77 | auto const before_load = chrono::steady_clock::now(); | 77 | auto const before_load = chrono::steady_clock::now(); |
| 78 | auto d2loader = routemon::datex2::loader{}; | 78 | auto d2loader = routemon::datex2::loader{}; |
| 79 | auto pub = routemon::datex2::situation_publication{}; | 79 | auto pub = routemon::datex2::situation_publication{}; |
| 80 | try | 80 | try |
| 81 | { | 81 | { |
| 82 | pub = | 82 | pub = |
| 83 | d2loader.load_situation_publication(config.situations.datex2_filename); | 83 | d2loader.load_situation_publication(config.situations.datex2_filename); |
| 84 | } | 84 | } |
| 85 | catch (std::exception const& e) | 85 | catch (std::exception const& e) |
| 86 | { | 86 | { |
| @@ -91,9 +91,9 @@ auto real_main(std::span<char const*> args) -> exit_status | |||
| 91 | { | 91 | { |
| 92 | auto const& warns = d2loader.warnings(); | 92 | auto const& warns = d2loader.warnings(); |
| 93 | l.warn( | 93 | l.warn( |
| 94 | "Encountered {} unique warnings while loading DATEX II situations " | 94 | "Encountered {} unique warnings while loading DATEX II situations " |
| 95 | "publication", | 95 | "publication", |
| 96 | warns.size()); | 96 | warns.size()); |
| 97 | auto i = 0uz; | 97 | auto i = 0uz; |
| 98 | for (auto it = warns.begin(); it != warns.end(); | 98 | for (auto it = warns.begin(); it != warns.end(); |
| 99 | it = warns.upper_bound(*it)) | 99 | it = warns.upper_bound(*it)) |
| @@ -108,12 +108,12 @@ auto real_main(std::span<char const*> args) -> exit_status | |||
| 108 | malloc_trim(0); | 108 | malloc_trim(0); |
| 109 | auto const after_load = chrono::steady_clock::now(); | 109 | auto const after_load = chrono::steady_clock::now(); |
| 110 | auto const dur_load = | 110 | auto const dur_load = |
| 111 | chrono::duration_cast<chrono::milliseconds>(after_load - before_load); | 111 | chrono::duration_cast<chrono::milliseconds>(after_load - before_load); |
| 112 | l.info("Loading situations finished in {}", dur_load); | 112 | l.info("Loading situations finished in {}", dur_load); |
| 113 | 113 | ||
| 114 | auto handler = routemon::api::handler{l, std::move(pub)}; | 114 | auto handler = routemon::api::handler{l, std::move(pub)}; |
| 115 | auto http_server = | 115 | auto http_server = |
| 116 | routemon::srv::server{l, std::move(lsel), std::move(handler)}; | 116 | routemon::srv::server{l, std::move(lsel), std::move(handler)}; |
| 117 | http_server.spawn(ioc); | 117 | http_server.spawn(ioc); |
| 118 | ioc.run(); | 118 | ioc.run(); |
| 119 | 119 | ||
| @@ -129,7 +129,9 @@ auto main(int argc, char* argv[]) -> int | |||
| 129 | return EXIT_FAILURE; | 129 | return EXIT_FAILURE; |
| 130 | } | 130 | } |
| 131 | auto res = real_main( | 131 | auto res = real_main( |
| 132 | std::span{const_cast<char const**>(argv), static_cast<std::size_t>(argc)}); | 132 | std::span{ |
| 133 | const_cast<char const**>(argv), static_cast<std::size_t>(argc) | ||
| 134 | }); | ||
| 133 | switch (res) | 135 | switch (res) |
| 134 | { | 136 | { |
| 135 | case exit_status::failure: | 137 | case exit_status::failure: |