mirror of https://github.com/ledisdb/ledisdb.git
Merge branch 'develop'
This commit is contained in:
commit
9b93ab9811
|
@ -14,7 +14,7 @@ LedisDB now supports multiple different databases as backends.
|
|||
+ Rich data structure: KV, List, Hash, ZSet, Set.
|
||||
+ Data storage is not limited by RAM.
|
||||
+ Various backends supported: LevelDB, goleveldb, LMDB, RocksDB, BoltDB, RAM.
|
||||
+ Supports transactions using LMDB or BotlDB.
|
||||
+ Supports transactions using LMDB or BoltDB.
|
||||
+ Supports Lua scripting.
|
||||
+ Supports expiration and TTL.
|
||||
+ Can be managed via redis-cli.
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = ""
|
||||
|
|
|
@ -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)
|
||||
|
@ -131,6 +131,8 @@ func (l *Ledis) flushAll() error {
|
|||
it := l.ldb.NewIterator()
|
||||
defer it.Close()
|
||||
|
||||
it.SeekToFirst()
|
||||
|
||||
w := l.ldb.NewWriteBatch()
|
||||
defer w.Rollback()
|
||||
|
||||
|
|
Loading…
Reference in New Issue