diff options
| author | Ibrahim Konsowa <imkonsowa@gmail.com> | 2025-08-02 19:21:57 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-02 08:21:57 -0700 |
| commit | 315fcc70b2121c45d3cc18cb3721e80e78171f8d (patch) | |
| tree | 73b8c97603d7712601a1c640590b51a789111465 /weed/notification/webhook/webhook_queue.go | |
| parent | 9d013ea9b8edbd6cf3030730a8a0ab02d00a47da (diff) | |
| download | seaweedfs-315fcc70b2121c45d3cc18cb3721e80e78171f8d.tar.xz seaweedfs-315fcc70b2121c45d3cc18cb3721e80e78171f8d.zip | |
fix: dead letter message log message (#7072)
Diffstat (limited to 'weed/notification/webhook/webhook_queue.go')
| -rw-r--r-- | weed/notification/webhook/webhook_queue.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/weed/notification/webhook/webhook_queue.go b/weed/notification/webhook/webhook_queue.go index b1b21bc9a..e034e9537 100644 --- a/weed/notification/webhook/webhook_queue.go +++ b/weed/notification/webhook/webhook_queue.go @@ -195,7 +195,11 @@ func (w *Queue) logDeadLetterMessages() error { go func() { for { select { - case msg := <-ch: + case msg, ok := <-ch: + if !ok { + glog.Info("dead letter channel closed") + return + } if msg == nil { glog.Errorf("received nil message from dead letter channel") continue @@ -208,7 +212,12 @@ func (w *Queue) logDeadLetterMessages() error { } payload := "" if msg.Payload != nil { - payload = string(msg.Payload) + var n filer_pb.EventNotification + if err := proto.Unmarshal(msg.Payload, &n); err != nil { + payload = fmt.Sprintf("failed to unmarshal payload: %v", err) + } else { + payload = n.String() + } } glog.Errorf("received dead letter message: %s, key: %s", payload, key) case <-w.ctx.Done(): |
