Repository navigation
fix: multiple gateway logic bugfixes - #468
Conversation
Signed-off-by: davfsa <davfsa@gmail.com>
Signed-off-by: davfsa <davfsa@gmail.com>
|
the goat |
Signed-off-by: davfsa <davfsa@gmail.com>
| g.config.SessionID = &readyEvent.SessionID | ||
| g.config.ResumeURL = &readyEvent.ResumeGatewayURL | ||
| g.config.Logger.Debug("ready message received") | ||
| g.config.Logger.Info("succesfully started", slog.String("sessionID", *g.config.SessionID)) |
There was a problem hiding this comment.
too verbose to be info level
| g.config.Logger.Info("succesfully started", slog.String("sessionID", *g.config.SessionID)) | |
| g.config.Logger.Debug("succesfully started", slog.String("session_id", *g.config.SessionID)) |
There was a problem hiding this comment.
The reason I moved them to Info is because they give insights to the shard without having to enable debug, which just spams the console for very large bots.
At the moment, any level of information is just behind the debug level and would be nice to move them out
There was a problem hiding this comment.
You can handle the event in your code and log there if needed, or you could also log to a file and grep the output.
There was a problem hiding this comment.
maybe it would be worth considering adding a level below debug for payloads?
then running debug wouldn't be as spammy
There was a problem hiding this comment.
good idea, payloads could be logged at slog.LevelDebug-1
There was a problem hiding this comment.
looks pretty good!
just some minor stuff
|
thanks! |
sync.Onceto avoid deadlocksdefer ready(nil)tolistento ensure it never leaves without setting the channel (avoid deadlocks)readyon invalid session and reconnect (if shard is not ready) to avoidopenfrom thinking the shard has successfully started when it hasn'treconnectTrywithdoReconnect, which is the same logic but it removes the recursiveness