Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config Singleton #4220

Merged
merged 29 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
920e0f6
WIP: Add Singleton
janusz-anue Jul 6, 2023
711e39a
Merge branch 'master' into config-singleton
janusz-anue Jul 6, 2023
6843b71
Change config singleton and refactor odin worker
janusz-anue Jul 10, 2023
4ac250f
changed config singleton interface
janusz-anue Jul 25, 2023
3cd3028
revert changes
janusz-anue Jul 26, 2023
4d06567
Remove toplevel references to config
janusz-anue Jul 26, 2023
bce2249
Clang tidy and format
janusz-anue Jul 26, 2023
8e3fd2c
Merge remote-tracking branch 'origin/master' into config-singleton
janusz-anue Jul 27, 2023
beb1f6d
Add test
janusz-anue Jul 27, 2023
1468a7e
Simplify test
janusz-anue Jul 27, 2023
5c3c32c
Remove additional config use
janusz-anue Jul 28, 2023
7792069
Merge branch 'master' into config-singleton
nilsnolde Jul 28, 2023
85a007b
Rename, simplify singleton and use other namespace
janusz-anue Aug 23, 2023
53089a9
clang-format
janusz-anue Aug 23, 2023
802399a
include sorting
janusz-anue Aug 23, 2023
a81af2b
test fix
janusz-anue Aug 23, 2023
744c5a0
Merge branch 'config-singleton' of https://github.com/janusz-anue/val…
janusz-anue Aug 23, 2023
5392b00
Merge branch 'master' into config-singleton
janusz-anue Aug 23, 2023
3a99057
Update CHANGELOG.md
janusz-anue Aug 28, 2023
207352f
Merge remote-tracking branch 'origin' into config-singleton
janusz-anue Aug 28, 2023
d81d41e
Merge branch 'master' into config-singleton
janusz-anue Sep 21, 2023
a6f7537
Move config singleton/Remove unnessecary function
janusz-anue Sep 22, 2023
a1bc499
Resolve naming collision
janusz-anue Sep 22, 2023
643d120
format
janusz-anue Sep 22, 2023
cd28d96
fix OneInstanceExisting test
janusz-anue Sep 22, 2023
d3ebf40
Fixed slipped file
janusz-anue Sep 22, 2023
dbde116
Add error handling and new exception to intercept
janusz-anue Sep 29, 2023
c045f29
Merge branch 'master' into config-singleton
johannes-no Oct 13, 2023
ef571e8
Update CHANGELOG.md
kevinkreiser Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* ADDED: support for `:forward` and `:backward` for `motor_vehicle`, `vehicle`, `foot` and `bicycle` tag prefixes [#4204](https://github.com/valhalla/valhalla/pull/4204)
* ADDED: add `valhalla_build_landmarks` to parse POIs from osm pbfs and store them as landmarks in the landmark sqlite database [#4201](https://github.com/valhalla/valhalla/pull/4201)
* ADDED: add primary key in the landmark sqlite database and a method to retrieve landmarks via their primary keys [#4224](https://github.com/valhalla/valhalla/pull/4224)
* CHANGED: the boost property tree config is now read in to a singleton that doesn't need to be passed down anymore [#4220](https://github.com/valhalla/valhalla/pull/4220)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you mind moving this to the bottom of the list

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill just move this and merge so as not to hold this up any longer. very sorry for the wait

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kevin.

* ADDED: update graph tile to allow adding landmarks to edge info, and refactor edgeinfo.cc [#4233](https://github.com/valhalla/valhalla/pull/4233)

## Release Date: 2023-05-11 Valhalla 3.4.0
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ set(valhalla_hdrs
${VALHALLA_SOURCE_DIR}/valhalla/worker.h
${VALHALLA_SOURCE_DIR}/valhalla/filesystem.h
${VALHALLA_SOURCE_DIR}/valhalla/proto_conversions.h
${VALHALLA_SOURCE_DIR}/valhalla/configuration.h
)

set(valhalla_src
Expand Down
17 changes: 8 additions & 9 deletions src/argparse_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <valhalla/baldr/rapidjson_utils.h>
#include <valhalla/config.h>
#include <valhalla/configuration.h>
#include <valhalla/filesystem.h>
#include <valhalla/midgard/logging.h>
#include <valhalla/midgard/util.h>
Expand All @@ -26,7 +27,6 @@
bool parse_common_args(const std::string& program,
const cxxopts::Options& opts,
const cxxopts::ParseResult& result,
boost::property_tree::ptree& pt,
const std::string& log,
const bool use_threads = false) {
if (result.count("help")) {
Expand All @@ -40,19 +40,18 @@
}

// Read the config file
boost::property_tree::ptree conf;
if (result.count("inline-config")) {
std::stringstream ss;
ss << result["inline-config"].as<std::string>();
rapidjson::read_json(ss, pt);
conf = valhalla::config(result["inline-config"].as<std::string>());
} else if (result.count("config") &&
filesystem::is_regular_file(result["config"].as<std::string>())) {
rapidjson::read_json(result["config"].as<std::string>(), pt);
conf = valhalla::config(result["config"].as<std::string>());

Check warning on line 48 in src/argparse_utils.h

View check run for this annotation

Codecov / codecov/patch

src/argparse_utils.h#L48

Added line #L48 was not covered by tests
} else {
throw cxxopts::OptionException("Configuration is required\n\n" + opts.help() + "\n\n");
}

// configure logging
auto logging_subtree = pt.get_child_optional(log);
auto logging_subtree = conf.get_child_optional(log);
if (logging_subtree) {
auto logging_config =
valhalla::midgard::ToMap<const boost::property_tree::ptree&,
Expand All @@ -64,9 +63,9 @@
// override concurrency config if specified as arg
auto num_threads = std::max(1U, result.count("concurrency")
? result["concurrency"].as<uint32_t>()
: pt.get<uint32_t>("mjolnir.concurrency",
std::thread::hardware_concurrency()));
pt.put<uint32_t>("mjolnir.concurrency", num_threads);
: conf.get<uint32_t>("mjolnir.concurrency",
std::thread::hardware_concurrency()));
conf.put<uint32_t>("mjolnir.concurrency", num_threads);

LOG_INFO("Running " + std::string(program) + " with " + std::to_string(num_threads) +
" thread(s).");
Expand Down
8 changes: 4 additions & 4 deletions src/mjolnir/valhalla_add_elevation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
int main(int argc, char** argv) {
const auto program = filesystem::path(__FILE__).stem().string();
// args
boost::property_tree::ptree config;
std::vector<std::string> tiles;

try {
Expand All @@ -88,7 +87,7 @@
// clang-format on

const auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, config, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))

Check warning on line 90 in src/mjolnir/valhalla_add_elevation.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_add_elevation.cc#L90

Added line #L90 was not covered by tests
return EXIT_SUCCESS;

if (!result.count("tiles")) {
Expand All @@ -112,12 +111,13 @@
}

// pass the deduplicated tiles
auto tile_ids = get_tile_ids(config, std::unordered_set<std::string>(tiles.begin(), tiles.end()));
auto tile_ids =
get_tile_ids(valhalla::config(), std::unordered_set<std::string>(tiles.begin(), tiles.end()));
if (tile_ids.empty()) {
std::cerr << "Failed to load tiles\n\n";
return EXIT_FAILURE;
}

ElevationBuilder::Build(config, tile_ids);
ElevationBuilder::Build(valhalla::config(), tile_ids);
return EXIT_SUCCESS;
}
5 changes: 3 additions & 2 deletions src/mjolnir/valhalla_add_predicted_traffic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ void update_tiles(
int main(int argc, char** argv) {
const auto program = filesystem::path(__FILE__).stem().string();
// args
boost::property_tree::ptree config;
filesystem::path traffic_tile_dir;
bool summary = false;

Expand All @@ -264,7 +263,7 @@ int main(int argc, char** argv) {
options.parse_positional({"traffic-tile-dir"});
options.positional_help("Traffic tile dir");
auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, config, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))
return EXIT_SUCCESS;

if (!result.count("traffic-tile-dir")) {
Expand All @@ -281,6 +280,8 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}

auto config = valhalla::config();

// configure logging
auto logging_subtree = config.get_child_optional("mjolnir.logging");
if (logging_subtree) {
Expand Down
6 changes: 3 additions & 3 deletions src/mjolnir/valhalla_assign_speeds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@

int main(int argc, char** argv) {
const auto program = filesystem::path(__FILE__).stem().string();
// args
bpt::ptree config;

try {
// clang-format off
Expand All @@ -97,7 +95,7 @@
// clang-format on

auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, config, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))

Check warning on line 98 in src/mjolnir/valhalla_assign_speeds.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_assign_speeds.cc#L98

Added line #L98 was not covered by tests
return EXIT_SUCCESS;
} catch (cxxopts::OptionException& e) {
std::cerr << e.what() << std::endl;
Expand All @@ -108,6 +106,8 @@
return EXIT_FAILURE;
}

auto config = valhalla::config();

Check warning on line 109 in src/mjolnir/valhalla_assign_speeds.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_assign_speeds.cc#L109

Added line #L109 was not covered by tests

// configure logging
config.get_child("mjolnir").erase("tile_extract");
config.get_child("mjolnir").erase("tile_url");
Expand Down
5 changes: 3 additions & 2 deletions src/mjolnir/valhalla_benchmark_admins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@
const auto program = filesystem::path(__FILE__).stem().string();
// args
std::vector<std::string> input_files;
boost::property_tree::ptree config;

try {
// clang-format off
Expand All @@ -218,7 +217,7 @@
// clang-format on

auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, config, "mjolnir.logging"))
if (!parse_common_args(program, options, result, "mjolnir.logging"))

Check warning on line 220 in src/mjolnir/valhalla_benchmark_admins.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_benchmark_admins.cc#L220

Added line #L220 was not covered by tests
return EXIT_SUCCESS;

if (result.count("version")) {
Expand All @@ -234,6 +233,8 @@
return EXIT_FAILURE;
}

auto config = valhalla::config();

Check warning on line 236 in src/mjolnir/valhalla_benchmark_admins.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_benchmark_admins.cc#L236

Added line #L236 was not covered by tests

// Configure logging
auto logging_subtree = config.get_child_optional("mjolnir.logging");
if (logging_subtree) {
Expand Down
7 changes: 3 additions & 4 deletions src/mjolnir/valhalla_build_admins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
const auto program = filesystem::path(__FILE__).stem().string();
// args
std::vector<std::string> input_files;
boost::property_tree::ptree pt;

try {
// clang-format off
Expand All @@ -37,7 +36,7 @@
options.parse_positional({"input_files"});
options.positional_help("OSM PBF file(s)");
auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging"))
if (!parse_common_args(program, options, result, "mjolnir.logging"))

Check warning on line 39 in src/mjolnir/valhalla_build_admins.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_admins.cc#L39

Added line #L39 was not covered by tests
return EXIT_SUCCESS;

// input files are positional
Expand All @@ -54,16 +53,16 @@
}

// configure logging
auto logging_subtree = pt.get_child_optional("mjolnir.logging");
auto logging_subtree = valhalla::config().get_child_optional("mjolnir.logging");

Check warning on line 56 in src/mjolnir/valhalla_build_admins.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_admins.cc#L56

Added line #L56 was not covered by tests
if (logging_subtree) {
auto logging_config =
valhalla::midgard::ToMap<const boost::property_tree::ptree&,
std::unordered_map<std::string, std::string>>(logging_subtree.get());
valhalla::midgard::logging::Configure(logging_config);
}

if (!valhalla::mjolnir::BuildAdminFromPBF(pt.get_child("mjolnir"), input_files)) {
if (!valhalla::mjolnir::BuildAdminFromPBF(valhalla::config().get_child("mjolnir"), input_files)) {
return EXIT_FAILURE;

Check warning on line 65 in src/mjolnir/valhalla_build_admins.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_admins.cc#L64-L65

Added lines #L64 - L65 were not covered by tests
};

return EXIT_SUCCESS;
Expand Down
6 changes: 2 additions & 4 deletions src/mjolnir/valhalla_build_connectivity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
// Main application to create a ppm image file of connectivity.
int main(int argc, char** argv) {
const auto program = filesystem::path(__FILE__).stem().string();
// args
boost::property_tree::ptree pt;
try {
// clang-format off
cxxopts::Options options(
Expand All @@ -64,7 +62,7 @@
// clang-format on

auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging"))
if (!parse_common_args(program, options, result, "mjolnir.logging"))
return EXIT_SUCCESS;
} catch (cxxopts::OptionException& e) {
std::cerr << e.what() << std::endl;
Expand All @@ -76,7 +74,7 @@
}

// Get something we can use to fetch tiles
valhalla::baldr::connectivity_map_t connectivity_map(pt.get_child("mjolnir"));
valhalla::baldr::connectivity_map_t connectivity_map(valhalla::config().get_child("mjolnir"));

Check warning on line 77 in src/mjolnir/valhalla_build_connectivity.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_connectivity.cc#L77

Added line #L77 was not covered by tests

uint32_t transit_level = TileHierarchy::levels().back().level + 1;
for (uint32_t level = 0; level <= transit_level; level++) {
Expand Down
8 changes: 4 additions & 4 deletions src/mjolnir/valhalla_build_landmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
const auto program = filesystem::path(__FILE__).stem().string();
// args
std::vector<std::string> input_files;
boost::property_tree::ptree pt;

try {
// clang-format off
Expand All @@ -32,7 +31,7 @@
options.parse_positional({"input_files"});
options.positional_help("OSM PBF file(s)");
auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging"))
if (!parse_common_args(program, options, result, "mjolnir.logging"))

Check warning on line 34 in src/mjolnir/valhalla_build_landmarks.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_landmarks.cc#L34

Added line #L34 was not covered by tests
return EXIT_SUCCESS;

// input files are positional
Expand All @@ -49,15 +48,16 @@
}

// configure logging
auto logging_subtree = pt.get_child_optional("mjolnir.logging");
auto logging_subtree = valhalla::config().get_child_optional("mjolnir.logging");

Check warning on line 51 in src/mjolnir/valhalla_build_landmarks.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_landmarks.cc#L51

Added line #L51 was not covered by tests
if (logging_subtree) {
auto logging_config =
valhalla::midgard::ToMap<const boost::property_tree::ptree&,
std::unordered_map<std::string, std::string>>(logging_subtree.get());
valhalla::midgard::logging::Configure(logging_config);
}

if (!valhalla::mjolnir::BuildLandmarkFromPBF(pt.get_child("mjolnir"), input_files)) {
if (!valhalla::mjolnir::BuildLandmarkFromPBF(valhalla::config().get_child("mjolnir"),

Check warning on line 59 in src/mjolnir/valhalla_build_landmarks.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_landmarks.cc#L59

Added line #L59 was not covered by tests
input_files)) {
return EXIT_FAILURE;
};

Expand Down
6 changes: 2 additions & 4 deletions src/mjolnir/valhalla_build_statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,6 @@

int main(int argc, char** argv) {
const auto program = filesystem::path(__FILE__).stem().string();
// args
boost::property_tree::ptree pt;

try {
// clang-format off
Expand All @@ -591,7 +589,7 @@
// clang-format on

auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))

Check warning on line 592 in src/mjolnir/valhalla_build_statistics.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_statistics.cc#L592

Added line #L592 was not covered by tests
return EXIT_SUCCESS;
} catch (cxxopts::OptionException& e) {
std::cerr << e.what() << std::endl;
Expand All @@ -602,7 +600,7 @@
return EXIT_FAILURE;
}

BuildStatistics(pt);
BuildStatistics(valhalla::config());

Check warning on line 603 in src/mjolnir/valhalla_build_statistics.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_build_statistics.cc#L603

Added line #L603 was not covered by tests

return EXIT_SUCCESS;
}
5 changes: 2 additions & 3 deletions src/mjolnir/valhalla_build_tiles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ int main(int argc, char** argv) {
std::vector<std::string> input_files;
BuildStage start_stage = BuildStage::kInitialize;
BuildStage end_stage = BuildStage::kCleanup;
boost::property_tree::ptree pt;

try {

Expand All @@ -58,7 +57,7 @@ int main(int argc, char** argv) {
options.parse_positional({"input_files"});
options.positional_help("OSM PBF file(s)");
auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))
return EXIT_SUCCESS;

// Convert stage strings to BuildStage
Expand Down Expand Up @@ -99,7 +98,7 @@ int main(int argc, char** argv) {
}

// Build some tiles!
if (build_tile_set(pt, input_files, start_stage, end_stage)) {
if (build_tile_set(valhalla::config(), input_files, start_stage, end_stage)) {
return EXIT_SUCCESS;
} else {
return EXIT_FAILURE;
Expand Down
4 changes: 3 additions & 1 deletion src/mjolnir/valhalla_convert_transit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
// clang-format on

auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))

Check warning on line 38 in src/mjolnir/valhalla_convert_transit.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_convert_transit.cc#L38

Added line #L38 was not covered by tests
return EXIT_SUCCESS;

pt = valhalla::config();

Check warning on line 41 in src/mjolnir/valhalla_convert_transit.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_convert_transit.cc#L41

Added line #L41 was not covered by tests

if (result.count("target_directory")) {
pt.get_child("mjolnir").erase("transit_dir");
pt.add("mjolnir.transit_dir", result["target_directory"].as<std::string>());
Expand Down
6 changes: 3 additions & 3 deletions src/mjolnir/valhalla_ingest_transit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

int main(int argc, char** argv) {
const auto program = filesystem::path(__FILE__).stem().string();
// args
boost::property_tree::ptree pt;

try {
// clang-format off
Expand All @@ -27,7 +25,7 @@
// clang-format on

auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))

Check warning on line 28 in src/mjolnir/valhalla_ingest_transit.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_ingest_transit.cc#L28

Added line #L28 was not covered by tests
return EXIT_SUCCESS;
} catch (cxxopts::OptionException& e) {
std::cerr << e.what() << std::endl;
Expand All @@ -38,6 +36,8 @@
return EXIT_FAILURE;
}

const auto& pt = valhalla::config();

Check warning on line 39 in src/mjolnir/valhalla_ingest_transit.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_ingest_transit.cc#L39

Added line #L39 was not covered by tests

// spawn threads to download all the tiles returning a list of
// tiles that ended up having dangling stop pairs
auto dangling_tiles = valhalla::mjolnir::ingest_transit(pt);
Expand Down
5 changes: 2 additions & 3 deletions src/mjolnir/valhalla_query_transit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@
int main(int argc, char* argv[]) {
const auto program = filesystem::path(__FILE__).stem().string();
// args
boost::property_tree::ptree pt;
double o_lng, o_lat, d_lng, d_lat;
std::string o_onestop_id, d_onestop_id, time;
int tripid;
Expand All @@ -392,7 +391,7 @@
// clang-format on

auto result = options.parse(argc, argv);
if (!parse_common_args(program, options, result, pt, "mjolnir.logging", true))
if (!parse_common_args(program, options, result, "mjolnir.logging", true))

Check warning on line 394 in src/mjolnir/valhalla_query_transit.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_query_transit.cc#L394

Added line #L394 was not covered by tests
return EXIT_SUCCESS;

for (const auto& arg : std::vector<std::string>{"o_onestop_id", "o_lat", "o_lng"}) {
Expand All @@ -413,7 +412,7 @@
LOG_INFO("Read config");

// Bail if no transit dir
auto transit_dir = pt.get_optional<std::string>("mjolnir.transit_dir");
auto transit_dir = valhalla::config().get_optional<std::string>("mjolnir.transit_dir");

Check warning on line 415 in src/mjolnir/valhalla_query_transit.cc

View check run for this annotation

Codecov / codecov/patch

src/mjolnir/valhalla_query_transit.cc#L415

Added line #L415 was not covered by tests
if (!transit_dir || !filesystem::exists(*transit_dir) || !filesystem::is_directory(*transit_dir)) {
LOG_INFO("Transit directory not found.");
return 0;
Expand Down
Loading
Loading