use 16 now for later refactor

I will try to support large db index for xcodis
This commit is contained in:
siddontang 2015-03-13 14:00:33 +08:00
parent 62124c233d
commit 09d57e28f6
4 changed files with 7 additions and 7 deletions

View File

@ -215,8 +215,8 @@ func (cfg *Config) adjust() {
cfg.ConnWriteBufferSize = getDefault(4*KB, cfg.ConnWriteBufferSize)
cfg.TTLCheckInterval = getDefault(1, cfg.TTLCheckInterval)
cfg.Databases = getDefault(0, cfg.Databases)
if cfg.Databases > 256 {
cfg.Databases = 256
if cfg.Databases > 16 {
cfg.Databases = 16
}
}

View File

@ -11,7 +11,7 @@ data_dir = "/tmp/ledis_server"
# Set the number of databases. You can use `select dbindex` to choose a db.
# dbindex must be in [0, databases - 1].
# Maximum databases is 256.
# Maximum databases is 16 now.
databases = 16
# Log server command, set empty to disable

View File

@ -11,8 +11,8 @@ data_dir = "/tmp/ledis_server"
# Set the number of databases. You can use `select dbindex` to choose a db.
# dbindex must be in [0, databases - 1].
# Maximum databases is 256.
databases = 256
# Maximum databases is 16 now.
databases = 16
# Log server command, set empty to disable
access_log = ""

View File

@ -45,8 +45,8 @@ func Open(cfg *config.Config) (*Ledis, error) {
if cfg.Databases == 0 {
cfg.Databases = 16
} else if cfg.Databases > 256 {
cfg.Databases = 256
} else if cfg.Databases > 16 {
cfg.Databases = 16
}
os.MkdirAll(cfg.DataDir, 0755)