Content
View differences
Updated by Jens Ulferts almost 9 years ago
Currently, the saving of work packages happens like this
1. Save work package
2. If work package has parent, update its attributes and save it (triggering the same set of callbacks again for the parent)
3. If work package has children, update their attributes and save them (triggering the same set of callbacks for each children)
4. If work package has relations that require scheduling, update the work packages the relation point to (triggering the same set of callbacks for every such work package)
This behaviour is very, very slow and error prone. Updates with work package relations spanning a couple of larger trees can easily take 10s of seconds. As updating a work package is one of the steps necessary when making changes to a timeline, and timelines changes will likely affect work packages, investing here would speed up using timelines.
On top of that, when updating multiple work packages at once (e.g. bulk update) each work package is considered individually leading e.g. to \#25462.
We should look into removing all of the after\_save hooks, possibly replacing them via a [Unit of work](https://martinfowler.com/eaaCatalog/unitOfWork.html) pattern.
1. Save work package
2. If work package has parent, update its attributes and save it (triggering the same set of callbacks again for the parent)
3. If work package has children, update their attributes and save them (triggering the same set of callbacks for each children)
4. If work package has relations that require scheduling, update the work packages the relation point to (triggering the same set of callbacks for every such work package)
This behaviour is very, very slow and error prone. Updates with work package relations spanning a couple of larger trees can easily take 10s of seconds. As updating a work package is one of the steps necessary when making changes to a timeline, and timelines changes will likely affect work packages, investing here would speed up using timelines.
On top of that, when updating multiple work packages at once (e.g. bulk update) each work package is considered individually leading e.g. to \#25462.
We should look into removing all of the after\_save hooks, possibly replacing them via a [Unit of work](https://martinfowler.com/eaaCatalog/unitOfWork.html) pattern.