-
Notifications
You must be signed in to change notification settings - Fork 23k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] rating: introduce the parent mixin
When creating a task, the satisfaction of the project is recomputed even if the task has not rating. This can lead to performance issue: concurrency error in Postgresql can happen if a task is created when somebody else tries to update the project. The satisfaction recomputation will give and concurrency error whereas it will return the same satisfaction percentage, since the task has no rating. The same problem will happens in every modules implementing the rating feature: project, helpdesk and livechat. This problem leads us to create the rating.parent.mixin in order to retrigger the computation only when a new rating appears on the parent object. We also unstore the field to make its computation lazy. Maybe in a near future, this field will be computed in SQL directly. The parent mixin allow us to standardize the behavior to all parent rating models. These optimizations should reduce the number of computation and speed up the task creation. opw-1902502 Task-1903565
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 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