[Tile-serving] [openstreetmap/osm2pgsql] New dependency manager (#1168)
Jochen Topf
notifications at github.com
Thu May 14 16:10:06 UTC 2020
@joto commented on this pull request.
> @@ -63,7 +63,17 @@ int main(int argc, char *argv[])
auto const outputs =
output_t::create_outputs(middle->get_query_instance(), options);
- osmdata_t osmdata{middle, outputs};
+ bool const need_dependencies =
+ std::any_of(outputs.cbegin(), outputs.cend(),
+ [](std::shared_ptr<output_t> const &output) {
+ return output->need_forward_dependencies();
+ });
+
+ auto dependency_manager = std::unique_ptr<dependency_manager_t>(
+ need_dependencies ? new full_dependency_manager_t{middle.get()}
+ : new dependency_manager_t{});
+
+ osmdata_t osmdata{dependency_manager.get(), middle, outputs};
Currently the dependency manager doesn't need any configuration. But if it does in the future, so I think it is better created here where the options are available.
Moving into osmdata would be possible, just as with middle and outputs. That's certainly something to consider, but I'd rather do all of them or none of them.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1168#discussion_r425257167
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20200514/bd8ac5f3/attachment-0001.htm>
More information about the Tile-serving
mailing list