Skip to content

Commit

Permalink
Merge pull request #11 from zapier/fix-queue
Browse files Browse the repository at this point in the history
Prevent Gitlab MR events from being dropped
  • Loading branch information
davidwin93 authored Jan 5, 2023
2 parents 43d7dd9 + 85e5b3a commit 7426773
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions pkg/gitlab_hooks/hook_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ func NewGitlabEventWorker(h *GitlabHooksHandler, js nats.JetStreamContext) *Gitl
}

func (w *GitlabEventWorker) processNoteEventStreamMsg(msg *NoteEventMsg) error {

w.processNoteEvent(msg)

return nil
_, err := w.processNoteEvent(msg)
return err
}

func (w *GitlabEventWorker) processMREventStreamMsg(msg *MergeRequestEventMsg) error {

w.processMergeRequestEvent(msg)

return nil
_, err := w.processMergeRequestEvent(msg)
return err
}
2 changes: 1 addition & 1 deletion pkg/gitlab_hooks/stream_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type MergeRequestEventMsg struct {
}

func (e *MergeRequestEventMsg) GetId() string {
return fmt.Sprintf("%d", e.payload.ObjectAttributes.ID)
return fmt.Sprintf("%d-%s", e.payload.ObjectAttributes.ID, e.payload.ObjectAttributes.Action)
}

func (e *MergeRequestEventMsg) DecodeEventData(b []byte) error {
Expand Down

0 comments on commit 7426773

Please sign in to comment.