From d8989e864f58709415d13b094c17c50e015dfa6c Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Wed, 5 Feb 2025 14:05:37 -0500 Subject: [PATCH] Use new ctask names --- backends/rapidpro/backend_test.go | 4 ++-- backends/rapidpro/channel_event.go | 2 +- backends/rapidpro/task.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backends/rapidpro/backend_test.go b/backends/rapidpro/backend_test.go index 53d9c487b..b27172a1a 100644 --- a/backends/rapidpro/backend_test.go +++ b/backends/rapidpro/backend_test.go @@ -1213,7 +1213,7 @@ func (ts *BackendTestSuite) TestWriteMsg() { err = writeMsgToDB(ctx, ts.b, msg, clog) ts.NoError(err) - ts.assertQueuedContactTask(msg.ContactID_, "msg_event", map[string]any{ + ts.assertQueuedContactTask(msg.ContactID_, "msg_received", map[string]any{ "channel_id": float64(10), "msg_id": float64(msg.ID_), "msg_uuid": string(msg.UUID()), @@ -1414,7 +1414,7 @@ func (ts *BackendTestSuite) TestMailroomEvents() { ts.Equal(contact.ID_, dbE.ContactID_) ts.Equal(contact.URNID_, dbE.ContactURNID_) - ts.assertQueuedContactTask(contact.ID_, "channel_event", map[string]any{ + ts.assertQueuedContactTask(contact.ID_, "event_received", map[string]any{ "event_id": float64(dbE.ID_), "event_type": "referral", "channel_id": float64(10), diff --git a/backends/rapidpro/channel_event.go b/backends/rapidpro/channel_event.go index b9decbb4e..7b2e1cc4b 100644 --- a/backends/rapidpro/channel_event.go +++ b/backends/rapidpro/channel_event.go @@ -167,7 +167,7 @@ func writeChannelEventToDB(ctx context.Context, b *backend, e *ChannelEvent, clo defer rc.Close() // if we had a problem queueing the event, log it - err = queueChannelEvent(rc, contact, e) + err = queueEventHandling(rc, contact, e) if err != nil { slog.Error("error queueing channel event", "error", err, "evt_id", e.ID_) } diff --git a/backends/rapidpro/task.go b/backends/rapidpro/task.go index 1f4c974ec..f0de924e6 100644 --- a/backends/rapidpro/task.go +++ b/backends/rapidpro/task.go @@ -24,10 +24,10 @@ func queueMsgHandling(rc redis.Conn, c *Contact, m *Msg) error { "new_contact": c.IsNew_, } - return queueMailroomTask(rc, "msg_event", m.OrgID_, m.ContactID_, body) + return queueMailroomTask(rc, "msg_received", m.OrgID_, m.ContactID_, body) } -func queueChannelEvent(rc redis.Conn, c *Contact, e *ChannelEvent) error { +func queueEventHandling(rc redis.Conn, c *Contact, e *ChannelEvent) error { body := map[string]any{ "event_id": e.ID_, "event_type": e.EventType_, @@ -42,7 +42,7 @@ func queueChannelEvent(rc redis.Conn, c *Contact, e *ChannelEvent) error { body["optin_id"] = e.OptInID_ } - return queueMailroomTask(rc, "channel_event", e.OrgID_, e.ContactID_, body) + return queueMailroomTask(rc, "event_received", e.OrgID_, e.ContactID_, body) } func queueMsgDeleted(rc redis.Conn, ch *Channel, msgID courier.MsgID, contactID ContactID) error {