aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-09-02 14:47:36 +0200
committerJakob Borg <jakob@nym.se>2014-09-02 14:47:36 +0200
commit5235e82bdaf31d29059ca9823b8726931676b2aa (patch)
treedbb83eedd76fcae7d8de5db734555bc14f89b5e9
parent10f071325726e8de1d44ec9ea1a7a9741f885c6d (diff)
downloadsyncthing-5235e82bdaf31d29059ca9823b8726931676b2aa.tar.gz
syncthing-5235e82bdaf31d29059ca9823b8726931676b2aa.zip
Limit number of open db files (fixes #587)
-rw-r--r--cmd/syncthing/main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go
index b18e30768..a9f24c089 100644
--- a/cmd/syncthing/main.go
+++ b/cmd/syncthing/main.go
@@ -38,6 +38,7 @@ import (
"github.com/syncthing/syncthing/upgrade"
"github.com/syncthing/syncthing/upnp"
"github.com/syndtr/goleveldb/leveldb"
+ "github.com/syndtr/goleveldb/leveldb/opt"
)
var (
@@ -398,7 +399,7 @@ func syncthingMain() {
// If this is the first time the user runs v0.9, archive the old indexes and config.
archiveLegacyConfig()
- db, err := leveldb.OpenFile(filepath.Join(confDir, "index"), nil)
+ db, err := leveldb.OpenFile(filepath.Join(confDir, "index"), &opt.Options{MaxOpenFiles: 100})
if err != nil {
l.Fatalln("Cannot open database:", err, "- Is another copy of Syncthing already running?")
}