Skip to content

Commit

Permalink
fixup! backfill: implement loop
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <sumner@beeper.com>
  • Loading branch information
sumnerevans committed Aug 6, 2023
1 parent 9cc6c34 commit 9e7edc1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backfillqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,13 @@ func (user *User) getRoomsForBackfillAndEnqueue(ctx context.Context) {

// Create all of the portals locally and enqueue backfill requests for
// all of them.
portals := []*Portal{}
txn, err := user.bridge.DB.Begin()
{
portals := []*Portal{}
var i int
for guid, roomInfo := range roomInfoResp.Rooms {
portal := user.bridge.GetPortalByGUIDWithTransaction(txn, guid)
for _, chatIdentifier := range chats {
roomInfo := roomInfoResp.Rooms[chatIdentifier.ChatGUID]
portal := user.bridge.GetPortalByGUIDWithTransaction(txn, chatIdentifier.ChatGUID)
portal.MXID = roomInfo.RoomID
portal.Update(txn)
portals = append(portals, portal)
Expand Down

0 comments on commit 9e7edc1

Please sign in to comment.