re-generate aof file during load database from replication master; Allow master-slave role switching

This commit is contained in:
finley
2022-12-08 03:49:23 +08:00
parent a5908f5ea4
commit 0d96ad295d
11 changed files with 190 additions and 56 deletions

View File

@@ -94,6 +94,13 @@ func (c *Connection) Write(b []byte) (int, error) {
return c.conn.Write(b)
}
func (c *Connection) Name() string {
if c.conn != nil {
return c.conn.RemoteAddr().String()
}
return ""
}
// Subscribe add current connection into subscribers of the given channel
func (c *Connection) Subscribe(channel string) {
c.mu.Lock()