Skip to content
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

Only count content from the last 30 days for active people #589

Merged
merged 4 commits into from
Mar 15, 2024

Conversation

BentiGorlich
Copy link
Member

calculating the active people for a magazine can take quite some time (3 - 8 seconds), because literally all content in this magazine is counted by user_id, change that to only content from the last 30 days and voilá it takes <1 second.

Granted the call is cached for an hour, but it is annoying to be the user that has to wait for that calculation.

Additionally I think counting only 30 days of content results in a better picture of the "active users"

calculating the active people for a magazine can take quite some time (3 - 8 **seconds**), because literally all content in this magazine is counted by `user_id`, change that to only content from the last 30 days and voilá it takes <1 second.
Granted the call is cached for an hour, but it is annoying to be the user that has to wait for that calculation.
Additionally I think counting only 30 days of content results in a better picture of the "active users"
@BentiGorlich BentiGorlich added the backend Backend related issues and pull requests label Mar 15, 2024
@BentiGorlich BentiGorlich self-assigned this Mar 15, 2024
@BentiGorlich BentiGorlich added this to the v1.5.0 milestone Mar 15, 2024
BentiGorlich and others added 3 commits March 15, 2024 15:15
- `findPeople` is also used for the stats page which should not be limited to any time frame
@BentiGorlich BentiGorlich merged commit bd699f6 into main Mar 15, 2024
7 checks passed
@BentiGorlich BentiGorlich deleted the performance/magazine-active-users branch March 15, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants