Limit number of open db files (fixes #587)
This commit is contained in:
@@ -38,6 +38,7 @@ import (
|
|||||||
"github.com/syncthing/syncthing/upgrade"
|
"github.com/syncthing/syncthing/upgrade"
|
||||||
"github.com/syncthing/syncthing/upnp"
|
"github.com/syncthing/syncthing/upnp"
|
||||||
"github.com/syndtr/goleveldb/leveldb"
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb/opt"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -398,7 +399,7 @@ func syncthingMain() {
|
|||||||
// If this is the first time the user runs v0.9, archive the old indexes and config.
|
// If this is the first time the user runs v0.9, archive the old indexes and config.
|
||||||
archiveLegacyConfig()
|
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 {
|
if err != nil {
|
||||||
l.Fatalln("Cannot open database:", err, "- Is another copy of Syncthing already running?")
|
l.Fatalln("Cannot open database:", err, "- Is another copy of Syncthing already running?")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user