Skip to content

Commit

Permalink
Adjust urn update
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Oct 21, 2024
1 parent 3ec20d8 commit 24bfdfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backends/rapidpro/contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func contactForURNTeams(ctx context.Context, b *backend, urn urns.URN, org OrgID
return contact, err
}

err = updateContactTeamsURN(b.db, contact.URNID_, urn.Identity().String())
err = updateContactTeamsURN(ctx, b.db, contact.URNID_, urn.Identity().String())
if err != nil {
logrus.WithError(err).WithField("urn", urn.Identity()).WithField("org_id", org).Error("error updating contact urn")
return contact, err
Expand Down
5 changes: 3 additions & 2 deletions backends/rapidpro/urn.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rapidpro

import (
"context"
"database/sql"
"database/sql/driver"
"fmt"
Expand Down Expand Up @@ -333,8 +334,8 @@ func fullyUpdateContactURN(db *sqlx.Tx, urn *DBContactURN) error {
return err
}

func updateContactTeamsURN(db *sqlx.DB, urnID ContactURNID, newURN string) error {
_, err := db.Exec(updateTeamsURN, newURN, urnID)
func updateContactTeamsURN(ctx context.Context, db *sqlx.DB, urnID ContactURNID, newURN string) error {
_, err := db.ExecContext(ctx, updateTeamsURN, newURN, urnID)
if err != nil {
logrus.WithError(err).WithField("urn_id", urnID).Error("error updating contact urn")
return err
Expand Down

0 comments on commit 24bfdfd

Please sign in to comment.