mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-10-25 00:50:31 +08:00
Adds delete from persistence
This commit is contained in:
@@ -165,13 +165,14 @@ func (s *Server) loadSubscriptions(v []persistence.Subscription) {
|
||||
// loadClients restores clients from the datastore.
|
||||
func (s *Server) loadClients(v []persistence.Client) {
|
||||
for _, cl := range v {
|
||||
s.Clients.Add(&clients.Client{
|
||||
ID: cl.ID,
|
||||
Listener: cl.Listener,
|
||||
Username: cl.Username,
|
||||
LWT: clients.LWT(cl.LWT),
|
||||
Subscriptions: cl.Subscriptions,
|
||||
})
|
||||
|
||||
c := clients.NewClientStub(s.System)
|
||||
c.ID = cl.ID
|
||||
c.Listener = cl.Listener
|
||||
c.Username = cl.Username
|
||||
c.LWT = clients.LWT(cl.LWT)
|
||||
c.Subscriptions = cl.Subscriptions
|
||||
s.Clients.Add(c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,9 +321,6 @@ func (s *Server) writeClient(cl *clients.Client, pk packets.Packet) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Log $SYS stats.
|
||||
// @TODO ...
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user