Stop storing messages in memory and pull from persistence. Closes #81 (#105)

This commit is contained in:
Gabe Kangas
2020-08-05 21:01:06 -07:00
committed by GitHub
parent a692904516
commit b0b5801c5f
2 changed files with 2 additions and 23 deletions

View File

@@ -18,8 +18,7 @@ var (
//Server represents the server which handles the chat
type server struct {
Messages []models.ChatMessage
Clients map[string]*Client
Clients map[string]*Client
pattern string
listener models.ChatListener
@@ -113,7 +112,6 @@ func (s *server) Listen() {
// broadcast a message to all clients
case msg := <-s.sendAllCh:
s.Messages = append(s.Messages, msg)
s.listener.MessageSent(msg)
s.sendAll(msg)
addMessage(msg)