diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-06-12 10:39:46 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-06-12 17:07:17 +0200 |
commit | 826cfa2022fbce7c3bf22b23b335f2080d878eaa (patch) | |
tree | c99b0a7ea1c46b762acbad30ab70c64b0c93eb30 /src/buildtool/storage/garbage_collector.hpp | |
parent | 4e0068a7e650ca9fb03e9c1a28dddcf1ddf2345c (diff) | |
download | justbuild-826cfa2022fbce7c3bf22b23b335f2080d878eaa.tar.gz |
GarbageCollector: Support removal of all generations at once
...that ignores compactification.
Diffstat (limited to 'src/buildtool/storage/garbage_collector.hpp')
-rw-r--r-- | src/buildtool/storage/garbage_collector.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/buildtool/storage/garbage_collector.hpp b/src/buildtool/storage/garbage_collector.hpp index f4966c28..e6bc8739 100644 --- a/src/buildtool/storage/garbage_collector.hpp +++ b/src/buildtool/storage/garbage_collector.hpp @@ -26,12 +26,18 @@ /// Responsible for deleting oldest generation. class GarbageCollector { public: - /// \brief Trigger garbage collection; unless no_rotation is given, this - /// will include rotation of generations and deleting the oldest generation. - /// \returns true on success. + /// \brief Trigger garbage collection + /// \param storage_config Storage to collect garbage in + /// \param no_rotation Skip rotation of generation and perform only steps + /// that can be done without losing existing cache. Incompatible with + /// gc_all. + /// \param gc_all Remove all cache generations at once. Incompatible with + /// no_rotation. + /// \return true on success. [[nodiscard]] auto static TriggerGarbageCollection( StorageConfig const& storage_config, - bool no_rotation = false) noexcept -> bool; + bool no_rotation = false, + bool gc_all = false) noexcept -> bool; /// \brief Acquire shared lock to prevent garbage collection from running. /// \param storage_config Storage to be locked. |