aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2023-01-02 00:38:31 +0000
committerJulio Capote <jcapote@gmail.com>2023-01-02 00:38:31 +0000
commita69f9cfc6ba6ff332d1e2d8303020d49443ca8cb (patch)
treea487561c677a1c54fecae70fa5f46294449bd1b4 /main.go
parentbce250b0e75812c4f61b925d898c320d6ef11c5c (diff)
downloadcommunique-a69f9cfc6ba6ff332d1e2d8303020d49443ca8cb.tar.gz
working dedup
Diffstat (limited to '')
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.go b/main.go
index 35b5b80..e65a600 100644
--- a/main.go
+++ b/main.go
@@ -39,6 +39,14 @@ func main() {
}
defer db.Close()
+ log.With("type", "db").Debug("Running GC")
+ err = db.RunValueLogGC(0.5)
+ if err == badger.ErrNoRewrite {
+ log.With("type", "db").Debug("Nothing to GC")
+ } else {
+ log.Fatal(err)
+ }
+
// Persister
persister := models.NewPersister(log, db)