From 23ca7415267b41a9e1892cb256bcd26d7083785f Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 12 Sep 2024 16:28:08 -0500 Subject: [PATCH] Use 'tasks:handler' queue name instead of 'handler' --- backends/rapidpro/backend_test.go | 8 ++++---- backends/rapidpro/task.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backends/rapidpro/backend_test.go b/backends/rapidpro/backend_test.go index ce8ff167e..a390cfd9b 100644 --- a/backends/rapidpro/backend_test.go +++ b/backends/rapidpro/backend_test.go @@ -1501,8 +1501,8 @@ func (ts *BackendTestSuite) assertNoQueuedContactTask(contactID ContactID) { rc := ts.b.rp.Get() defer rc.Close() - assertredis.ZCard(ts.T(), rc, "handler:1", 0) - assertredis.ZCard(ts.T(), rc, "handler:active", 0) + assertredis.ZCard(ts.T(), rc, "tasks:handler:1", 0) + assertredis.ZCard(ts.T(), rc, "tasks:handler:active", 0) assertredis.LLen(ts.T(), rc, fmt.Sprintf("c:1:%d", contactID), 0) } @@ -1510,8 +1510,8 @@ func (ts *BackendTestSuite) assertQueuedContactTask(contactID ContactID, expecte rc := ts.b.rp.Get() defer rc.Close() - assertredis.ZCard(ts.T(), rc, "handler:1", 1) - assertredis.ZCard(ts.T(), rc, "handler:active", 1) + assertredis.ZCard(ts.T(), rc, "tasks:handler:1", 1) + assertredis.ZCard(ts.T(), rc, "tasks:handler:active", 1) assertredis.LLen(ts.T(), rc, fmt.Sprintf("c:1:%d", contactID), 1) data, err := redis.Bytes(rc.Do("LPOP", fmt.Sprintf("c:1:%d", contactID))) diff --git a/backends/rapidpro/task.go b/backends/rapidpro/task.go index 4dff8668b..1f4c974ec 100644 --- a/backends/rapidpro/task.go +++ b/backends/rapidpro/task.go @@ -71,10 +71,10 @@ func queueMailroomTask(rc redis.Conn, taskType string, orgID OrgID, contactID Co // we do all our queueing in a transaction contactQueue := fmt.Sprintf("c:%d:%d", orgID, contactID) - rc.Send("multi") - rc.Send("rpush", contactQueue, eventJSON) - rc.Send("zadd", fmt.Sprintf("handler:%d", orgID), fmt.Sprintf("%.5f", epochFloat-10000000), contactJSON) - rc.Send("zincrby", "handler:active", 0, orgID) + rc.Send("MULTI") + rc.Send("RPUSH", contactQueue, eventJSON) + rc.Send("ZADD", fmt.Sprintf("tasks:handler:%d", orgID), fmt.Sprintf("%.5f", epochFloat-10000000), contactJSON) + rc.Send("ZINCRBY", "tasks:handler:active", 0, orgID) _, err = rc.Do("EXEC") return err