-
Notifications
You must be signed in to change notification settings - Fork 205
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
activity view: populate jobs in batches #3464
Conversation
This is to avoid hitting resource limits by making too many ajax requests at the same time. See: https://progress.opensuse.org/issues/58304
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely better than before, also the limit to 5000 results. I'm only wondering whether it would be better to create a new route which returns all the data we want to show at once (although it is also kind of nice to see already the first jobs while the rest is still loading).
Codecov Report
@@ Coverage Diff @@
## master #3464 +/- ##
==========================================
- Coverage 95.56% 95.52% -0.04%
==========================================
Files 366 366
Lines 31556 31556
==========================================
- Hits 30155 30143 -12
- Misses 1401 1413 +12
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You managed to introduce four different magic numbers in this seemingly simple change. This looks it could be done better. Also, do we really need to manually call a for loop and do the calculation this way in javascript code? Isn't that such a common problem that a better approach must exist including the backing off with timeout?
I'm not aware that standard Javascript has a natural solution for that. I think we can hold off on this for now anyway since it only affects extreme cases and regular users seem to be okay with the current code. And we can revisit it later if needed. |
I would at least add |
That on its own will not address the issues. Even the search can handle more than that with more data. It's the too many individual requests being made. |
This is to avoid hitting resource limits by making too many ajax requests at the same time.
With a sufficient amount of
job_
events in the activity view, the browser may become unresponsive and also throw errors because the requests fail.See: https://progress.opensuse.org/issues/58304