mirror of https://github.com/ledisdb/ledisdb.git
use 16 now for later refactor
I will try to support large db index for xcodis
This commit is contained in:
parent
62124c233d
commit
09d57e28f6
|
@ -215,8 +215,8 @@ func (cfg *Config) adjust() {
|
||||||
cfg.ConnWriteBufferSize = getDefault(4*KB, cfg.ConnWriteBufferSize)
|
cfg.ConnWriteBufferSize = getDefault(4*KB, cfg.ConnWriteBufferSize)
|
||||||
cfg.TTLCheckInterval = getDefault(1, cfg.TTLCheckInterval)
|
cfg.TTLCheckInterval = getDefault(1, cfg.TTLCheckInterval)
|
||||||
cfg.Databases = getDefault(0, cfg.Databases)
|
cfg.Databases = getDefault(0, cfg.Databases)
|
||||||
if cfg.Databases > 256 {
|
if cfg.Databases > 16 {
|
||||||
cfg.Databases = 256
|
cfg.Databases = 16
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ data_dir = "/tmp/ledis_server"
|
||||||
|
|
||||||
# Set the number of databases. You can use `select dbindex` to choose a db.
|
# Set the number of databases. You can use `select dbindex` to choose a db.
|
||||||
# dbindex must be in [0, databases - 1].
|
# dbindex must be in [0, databases - 1].
|
||||||
# Maximum databases is 256.
|
# Maximum databases is 16 now.
|
||||||
databases = 16
|
databases = 16
|
||||||
|
|
||||||
# Log server command, set empty to disable
|
# Log server command, set empty to disable
|
||||||
|
|
|
@ -11,8 +11,8 @@ data_dir = "/tmp/ledis_server"
|
||||||
|
|
||||||
# Set the number of databases. You can use `select dbindex` to choose a db.
|
# Set the number of databases. You can use `select dbindex` to choose a db.
|
||||||
# dbindex must be in [0, databases - 1].
|
# dbindex must be in [0, databases - 1].
|
||||||
# Maximum databases is 256.
|
# Maximum databases is 16 now.
|
||||||
databases = 256
|
databases = 16
|
||||||
|
|
||||||
# Log server command, set empty to disable
|
# Log server command, set empty to disable
|
||||||
access_log = ""
|
access_log = ""
|
||||||
|
|
|
@ -45,8 +45,8 @@ func Open(cfg *config.Config) (*Ledis, error) {
|
||||||
|
|
||||||
if cfg.Databases == 0 {
|
if cfg.Databases == 0 {
|
||||||
cfg.Databases = 16
|
cfg.Databases = 16
|
||||||
} else if cfg.Databases > 256 {
|
} else if cfg.Databases > 16 {
|
||||||
cfg.Databases = 256
|
cfg.Databases = 16
|
||||||
}
|
}
|
||||||
|
|
||||||
os.MkdirAll(cfg.DataDir, 0755)
|
os.MkdirAll(cfg.DataDir, 0755)
|
||||||
|
|
Loading…
Reference in New Issue