Skip to content

Avoid additional uncached requests to SegmentEditor.getAll #21580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 23, 2023
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Nov 21, 2023

Description:

With #21521 we introduced a check within the API method SegmentEditor.getAll to filter away segments that aren't valid anymore. Depending on the amount of stored segment, this might take some time.

To avoid the filtering multiple times during a request we should avoid calling the API directly, but use SegmentEditor::getAllSegmentsForSite instead. This method caches the results for the current request.

This PR changes a couple of direct API usages to use SegmentEditor::getAllSegmentsForSite instead.

refs DEV-17463

Review

@sgiehl sgiehl added c: Performance For when we could improve the performance / speed of Matomo. Needs Review PRs that need a code review labels Nov 21, 2023
@sgiehl sgiehl added this to the 5.0.0 milestone Nov 21, 2023
@sgiehl sgiehl requested a review from a team November 21, 2023 10:01
@sgiehl sgiehl force-pushed the dev-17463 branch 2 times, most recently from 83bb67a to bef0307 Compare November 21, 2023 10:10
@sgiehl sgiehl merged commit b4207ef into 5.x-dev Nov 23, 2023
@sgiehl sgiehl deleted the dev-17463 branch November 23, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. Needs Review PRs that need a code review
Development

Successfully merging this pull request may close these issues.

3 participants