summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2016-04-22 07:34:11 +0000
committerAudrius Butkevicius <audrius.butkevicius@gmail.com>2016-04-22 07:34:11 +0000
commitccfcdf7f4885839ed72e8107baa058ad10f7d5b6 (patch)
treee4f4416e463414df1311ce1d5093847fa9a5df20
parent4eb23a38b1ceb2c522cb589db2b6e987fd9e915c (diff)
cmd/syncthing: Don't compact database at startup
This happens automatically in the background anyway, and it can take a long time on low powered devices at an inconvenient time. We just want to get up and running as quickly as possible. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3000
-rw-r--r--cmd/syncthing/main.go7
-rw-r--r--lib/db/leveldb_dbinstance.go4
2 files changed, 0 insertions, 11 deletions
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go
index 27a1099bd9..04e2d28164 100644
--- a/cmd/syncthing/main.go
+++ b/cmd/syncthing/main.go
@@ -662,13 +662,6 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
}
}
- // Pack and optimize the database
- if err := ldb.Compact(); err != nil {
- // I don't think this is fatal, but who knows. If it is, we'll surely
- // get an error when trying to write to the db later.
- l.Infoln("Compacting database:", err)
- }
-
m := model.NewModel(cfg, myID, myDeviceName(cfg), "syncthing", Version, ldb, protectedFiles)
cfg.Subscribe(m)
diff --git a/lib/db/leveldb_dbinstance.go b/lib/db/leveldb_dbinstance.go
index 56aff79135..565cf9da65 100644
--- a/lib/db/leveldb_dbinstance.go
+++ b/lib/db/leveldb_dbinstance.go
@@ -91,10 +91,6 @@ func newDBInstance(db *leveldb.DB) *Instance {
return i
}
-func (db *Instance) Compact() error {
- return db.CompactRange(util.Range{})
-}
-
func (db *Instance) genericReplace(folder, device []byte, fs []protocol.FileInfo, localSize, globalSize *sizeTracker, deleteFn deletionHandler) int64 {
sort.Sort(fileList(fs)) // sort list on name, same as in the database