mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
update comments
This commit is contained in:
@@ -151,7 +151,7 @@ func (handler *Handler) FinishRewrite(ctx *RewriteCtx) {
|
||||
}
|
||||
handler.aofFile = aofFile
|
||||
|
||||
// reset selected db 重新写入一次 select 指令保证 aof 中的数据库与 handler.currentDB 一致
|
||||
// write select command again to ensure aof file has the same db index with handler.currentDB
|
||||
data = protocol.MakeMultiBulkReply(utils.ToCmdLine("SELECT", strconv.Itoa(handler.currentDB))).ToBytes()
|
||||
_, err = handler.aofFile.Write(data)
|
||||
if err != nil {
|
||||
|
@@ -294,7 +294,7 @@ func execKeys(db *DB, args [][]byte) redis.Reply {
|
||||
func toTTLCmd(db *DB, key string) *protocol.MultiBulkReply {
|
||||
raw, exists := db.ttlMap.Get(key)
|
||||
if !exists {
|
||||
// 无 TTL
|
||||
// has no TTL
|
||||
return protocol.MakeMultiBulkReply(utils.ToCmdLine("PERSIST", key))
|
||||
}
|
||||
expireTime, _ := raw.(time.Time)
|
||||
|
@@ -309,6 +309,7 @@ func (mdb *MultiDB) doPsync() error {
|
||||
}
|
||||
// there is no CRLF between RDB and following AOF, reset stream to avoid parser error
|
||||
mdb.replication.masterChan = parser.ParseStream(mdb.replication.masterConn)
|
||||
// fixme: update aof file
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user