Fix rebuild
This commit is contained in:
parent
55fa6c0623
commit
65fd49a81c
@ -256,13 +256,20 @@ class RoomChannel {
|
|||||||
data[channelId].push(room.localpart)
|
data[channelId].push(room.localpart)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This part must be done atomicly:
|
// ************ ATOMIC PART ****************
|
||||||
this._readData(data)
|
// The rebuild process can remove some rooms (for example if prosody-room-type is changed),
|
||||||
|
// So we must mark all previous rooms as to refresh:
|
||||||
// Now we must mark all rooms for conf update.
|
// Now we must mark all rooms for conf update.
|
||||||
for (const roomJID of this.room2Channel.keys()) {
|
for (const roomJID of this.room2Channel.keys()) {
|
||||||
this.roomConfToUpdate.set(roomJID, true)
|
this.roomConfToUpdate.set(roomJID, true)
|
||||||
}
|
}
|
||||||
|
// This part must be done atomicly:
|
||||||
|
this._readData(data)
|
||||||
|
// Now we must mark all rooms for conf update.
|
||||||
|
for (const roomJID of this.room2Channel.keys()) {
|
||||||
|
this.roomConfToUpdate.set(roomJID, true)
|
||||||
|
}
|
||||||
|
// ************ END OF ATOMIC PART ****************
|
||||||
|
|
||||||
await this.sync() // FIXME: or maybe scheduleSync ?
|
await this.sync() // FIXME: or maybe scheduleSync ?
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user