-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle accumulated affiliations efficiently
Affiliations where stored in the mongoose_acc for atomicity, and performance. If a message processing pipeline in a room starts with certain affiliations at the time of that message, we don't want to have some handlers in the pipeline process the message with certain affs, only to have the affiliations changed concurrently and the next handler, for the same message, be processed with different ones. But the code as currently written was quite redundant. The main call to get the affiliations from the accumulator, was running the hook that would check the acc, the cache, and the DB. We can skip that hook if we're already in the context of muc_light and simply check if the affiliations are already in the accumulator, and only if not then we run the hook. Also take the opportunity to tag the affiliations stored in the accumulator, with the room's jid, just to avoid the (though improbable) chance of more than one room's affiliations being accumulated under the same key.
- Loading branch information
1 parent
ba2e32f
commit 884ca87
Showing
3 changed files
with
31 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters