mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-22 22:40:30 +08:00
调整缓存索引数据库缓存尺寸
This commit is contained in:
@@ -68,7 +68,7 @@ func (this *FileListDB) Open(dbPath string) error {
|
|||||||
var cacheSize = 512
|
var cacheSize = 512
|
||||||
var memoryGB = utils.SystemMemoryGB()
|
var memoryGB = utils.SystemMemoryGB()
|
||||||
if memoryGB >= 1 {
|
if memoryGB >= 1 {
|
||||||
cacheSize = 128 * memoryGB
|
cacheSize = 256 * memoryGB
|
||||||
}
|
}
|
||||||
|
|
||||||
// write db
|
// write db
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ func TestFileListDB_Memory(t *testing.T) {
|
|||||||
_ = db.Close()
|
_ = db.Close()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
err := db.Open(Tea.Root + "/data/db-0.db")
|
err := db.Open(Tea.Root + "/data/cache-index/p1/db-0.db")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user