Adds delete from persistence

This commit is contained in:
Mochi
2020-02-02 14:38:39 +00:00
parent 4a10b0b676
commit 85f269af5d
8 changed files with 488 additions and 58 deletions

View File

@@ -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
}