diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-10-08 16:57:48 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-10-25 13:00:43 +0200 |
commit | 30fed59c215e786745c66481bf3ecafb40c2b3be (patch) | |
tree | c65e90078a34ca0ff75e0cb14310e5f0ac3d912d /src/buildtool/serve_api/serve_service/source_tree.hpp | |
parent | a5567a39fc5b73f69c72eb7304fba484c9b049a1 (diff) | |
download | justbuild-30fed59c215e786745c66481bf3ecafb40c2b3be.tar.gz |
serve service: Give SourceTreeService access to both local storages
...native and compatible, even if currently only native is active.
While there, be more explicit in which storage instance is being
used.
Diffstat (limited to 'src/buildtool/serve_api/serve_service/source_tree.hpp')
-rw-r--r-- | src/buildtool/serve_api/serve_service/source_tree.hpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/buildtool/serve_api/serve_service/source_tree.hpp b/src/buildtool/serve_api/serve_service/source_tree.hpp index fb0259f9..7a63bcf9 100644 --- a/src/buildtool/serve_api/serve_service/source_tree.hpp +++ b/src/buildtool/serve_api/serve_service/source_tree.hpp @@ -37,8 +37,6 @@ #include "src/buildtool/file_system/symlinks_map/resolve_symlinks_map.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/serve_api/remote/config.hpp" -#include "src/buildtool/storage/config.hpp" -#include "src/buildtool/storage/storage.hpp" #include "src/utils/cpp/expected.hpp" // Service for improved interaction with the target-level cache. @@ -63,12 +61,13 @@ class SourceTreeService final explicit SourceTreeService( gsl::not_null<RemoteServeConfig const*> const& serve_config, - gsl::not_null<LocalContext const*> const& local_context, - gsl::not_null<ApiBundle const*> const& apis) noexcept + gsl::not_null<ApiBundle const*> const& apis, + gsl::not_null<LocalContext const*> const& native_context, + LocalContext const* compat_context = nullptr) noexcept : serve_config_{*serve_config}, - storage_{*local_context->storage}, - storage_config_{*local_context->storage_config}, - apis_{*apis} {} + apis_{*apis}, + native_context_{native_context}, + compat_context_{compat_context} {} // Retrieve the Git-subtree identifier from a given Git commit. // @@ -135,9 +134,9 @@ class SourceTreeService final private: RemoteServeConfig const& serve_config_; - StorageConfig const& storage_config_; - Storage const& storage_; ApiBundle const& apis_; + gsl::not_null<LocalContext const*> native_context_; + LocalContext const* compat_context_; mutable std::shared_mutex mutex_; std::shared_ptr<Logger> logger_{std::make_shared<Logger>("serve-service")}; // symlinks resolver map |