Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/websocket-server/internal/domain/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ func (d *domain) HandleWebSocketForLogs(ctx context.Context, c *websocket.Conn)

resources := make(map[string]*Subscription)

defer func() {
for _, v := range resources {
if v.jc != nil {
if err := v.jc.Stop(ctx); err != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (llm): Consider logging more context-specific information along with the error message. This could include identifiers or states relevant to the Subscription or jetstream consumer that failed to stop. It will make debugging easier by providing more insights into why the stop operation failed.

log.Warnf("stop jetstream consumer: %w", err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (llm): The error wrapping directive %w is used with fmt.Errorf for error wrapping. For logging purposes, especially with log.Warnf, you should use %v to format the error. This prevents potential confusion and maintains consistency in error logging.

}
}
}
}()

type Message struct {
Event string `json:"event"`
Data LogsReqData `json:"data"`
Expand Down