Skip to content

Conversation

@MrKeiKun
Copy link
Contributor

@MrKeiKun MrKeiKun commented Oct 5, 2025

Description
This PR implements automatic garbage collection (GC) execution for Sietch vaults when the configured GC threshold is exceeded. The feature ensures storage efficiency by automatically cleaning up unused or orphaned chunks without requiring manual intervention. With the following:

  • Prevents deduplication index and storage from growing indefinitely
  • Maintains vault health automatically in the background
  • Improves user experience with zero-maintenance operation
  • Complements existing manual sietch dedup gc command

Configuration Options:

deduplication:
  auto_gc:
    enabled: true              # Enable automatic GC
    check_interval: "1h"       # Check every hour
    auto_gc_threshold: 1000    # Auto-trigger threshold
    enable_logging: true       # Enable GC logging
    log_file: ".sietch/logs/gc.log"
    alert_threshold: 5000      # Alert threshold
    alert_webhook: "https://hooks.example.com/alerts"

New Files

  • internal/gc/monitor.go - New automatic GC monitoring service
  • internal/gc/manager.go - GC manager for vault lifecycle

Referenced Issue: #95

@codecov
Copy link

codecov bot commented Oct 5, 2025

Codecov Report

❌ Patch coverage is 0% with 308 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/gc/monitor.go 0.00% 155 Missing ⚠️
internal/gc/manager.go 0.00% 98 Missing ⚠️
cmd/root.go 0.00% 40 Missing ⚠️
internal/config/vault.go 0.00% 11 Missing ⚠️
cmd/init.go 0.00% 2 Missing ⚠️
cmd/scaffold.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@MrKeiKun
Copy link
Contributor Author

MrKeiKun commented Oct 5, 2025

oh wait i didnt add the tests LOL

EDIT:
i'll add the test on another PR related to #69

@MrKeiKun
Copy link
Contributor Author

@SubstantialCattle5 this is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant