Skip to content

Commit 034308d

Browse files
authored
Merge pull request #833 from nyaruka/new_ctask_names
Use new ctask names
2 parents e141f4c + d8989e8 commit 034308d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: backends/rapidpro/backend_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ func (ts *BackendTestSuite) TestWriteMsg() {
12131213
err = writeMsgToDB(ctx, ts.b, msg, clog)
12141214
ts.NoError(err)
12151215

1216-
ts.assertQueuedContactTask(msg.ContactID_, "msg_event", map[string]any{
1216+
ts.assertQueuedContactTask(msg.ContactID_, "msg_received", map[string]any{
12171217
"channel_id": float64(10),
12181218
"msg_id": float64(msg.ID_),
12191219
"msg_uuid": string(msg.UUID()),
@@ -1414,7 +1414,7 @@ func (ts *BackendTestSuite) TestMailroomEvents() {
14141414
ts.Equal(contact.ID_, dbE.ContactID_)
14151415
ts.Equal(contact.URNID_, dbE.ContactURNID_)
14161416

1417-
ts.assertQueuedContactTask(contact.ID_, "channel_event", map[string]any{
1417+
ts.assertQueuedContactTask(contact.ID_, "event_received", map[string]any{
14181418
"event_id": float64(dbE.ID_),
14191419
"event_type": "referral",
14201420
"channel_id": float64(10),

Diff for: backends/rapidpro/channel_event.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func writeChannelEventToDB(ctx context.Context, b *backend, e *ChannelEvent, clo
167167
defer rc.Close()
168168

169169
// if we had a problem queueing the event, log it
170-
err = queueChannelEvent(rc, contact, e)
170+
err = queueEventHandling(rc, contact, e)
171171
if err != nil {
172172
slog.Error("error queueing channel event", "error", err, "evt_id", e.ID_)
173173
}

Diff for: backends/rapidpro/task.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func queueMsgHandling(rc redis.Conn, c *Contact, m *Msg) error {
2424
"new_contact": c.IsNew_,
2525
}
2626

27-
return queueMailroomTask(rc, "msg_event", m.OrgID_, m.ContactID_, body)
27+
return queueMailroomTask(rc, "msg_received", m.OrgID_, m.ContactID_, body)
2828
}
2929

30-
func queueChannelEvent(rc redis.Conn, c *Contact, e *ChannelEvent) error {
30+
func queueEventHandling(rc redis.Conn, c *Contact, e *ChannelEvent) error {
3131
body := map[string]any{
3232
"event_id": e.ID_,
3333
"event_type": e.EventType_,
@@ -42,7 +42,7 @@ func queueChannelEvent(rc redis.Conn, c *Contact, e *ChannelEvent) error {
4242
body["optin_id"] = e.OptInID_
4343
}
4444

45-
return queueMailroomTask(rc, "channel_event", e.OrgID_, e.ContactID_, body)
45+
return queueMailroomTask(rc, "event_received", e.OrgID_, e.ContactID_, body)
4646
}
4747

4848
func queueMsgDeleted(rc redis.Conn, ch *Channel, msgID courier.MsgID, contactID ContactID) error {

0 commit comments

Comments
 (0)