From 2296759242b9d057e356170973762b76d9644c6d Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 17 Jul 2024 10:51:58 +0200 Subject: Take shared repo-gc lock wherever needed --- src/other_tools/just_mr/launch.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/other_tools/just_mr/launch.cpp') diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index 1d211cd9..642f5f73 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -25,6 +25,7 @@ #include "src/buildtool/multithreading/task_system.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/garbage_collector.hpp" +#include "src/buildtool/storage/repository_garbage_collector.hpp" #include "src/other_tools/just_mr/exit_codes.hpp" #include "src/other_tools/just_mr/setup.hpp" #include "src/other_tools/just_mr/setup_utils.hpp" @@ -64,6 +65,11 @@ auto CallJust(std::optional const& config_file, if (subcommand and kKnownJustSubcommands.contains(*subcommand)) { // Read the config file if needed if (kKnownJustSubcommands.at(*subcommand).config) { + auto repo_lock = + RepositoryGarbageCollector::SharedLock(storage_config); + if (not repo_lock) { + return kExitGenericFailure; + } lock = GarbageCollector::SharedLock(storage_config); if (not lock) { return kExitGenericFailure; -- cgit v1.2.3