Fix linting errors
This commit is contained in:
@@ -23,8 +23,8 @@ func New(nc *nats.Conn, b *bus.NotifyBus) (*Server, error) {
|
||||
return &Server{conn: nc, Subject: DefaultSubject, bus: b}, nil
|
||||
}
|
||||
|
||||
func (s *Server) Close() {
|
||||
s.conn.Drain()
|
||||
func (s *Server) Close() error {
|
||||
return s.conn.Drain()
|
||||
}
|
||||
|
||||
func (s *Server) Start() error {
|
||||
@@ -59,14 +59,18 @@ func (s *Server) Start() error {
|
||||
|
||||
if err := json.Unmarshal(msg.Data(), &bn); err != nil {
|
||||
slog.Warn("Error unmarshalling message", "error", err)
|
||||
msg.TermWithReason("failed to decode json")
|
||||
if err := msg.TermWithReason("failed to decode json"); err != nil {
|
||||
slog.Error("Error terminating message", "error", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
id, err := s.bus.Notify(bn)
|
||||
if err != nil {
|
||||
slog.Warn("Error sending notification", "error", err)
|
||||
msg.NakWithDelay(1 * time.Minute)
|
||||
if err := msg.NakWithDelay(1 * time.Minute); err != nil {
|
||||
slog.Error("Error naking message", "error", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
slog.Info("Sent notification", "id", id)
|
||||
|
Reference in New Issue
Block a user