-
Notifications
You must be signed in to change notification settings - Fork 204
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
Django's image admin view times out #5174
Comments
The #5175 PR did not fix the issue, so I'm reopening it. Edit: My next guess is that the issue can originate from the filters. Looking again at what occurs during these requests, I found the following query: SELECT DISTINCT "audio"."source" FROM "audio" ORDER BY "audio"."source" ASC Notices the openverse/api/api/admin/media_report.py Lines 529 to 534 in ceed798
The audio table can easily handle it (for now) but it isn't feasible for images. Luckily, we can easily fix it, given we know exactly how many sources there are and which ones they are. We only need to query with the |
Fixed in #5189. |
Description
The
/admin/api/image/
view doesn't load with production data. You can confirm this by trying to access in staging (duplicates production data) if you have access: https://api-staging.openverse.org/admin/api/image/I wondered if this was caused due to a heavy DB query and got what was being executed locally (see below). I used the same query in Grafana against the staging and production databases, and the result was returned immediately, so a problem at the DB level was discarded.
query
The query returns a count of 458, which the admin might be trying to load all at once, causing a rendering issue. Instead, the audio view (
admin/api/audio/
), with only 38 audio tracks reported, loads fine. We should limit the number of media items shown on these pages and paginate them.Reproduction
Screenshots
The image view when trying to access it.
The audio view loading fine.
The text was updated successfully, but these errors were encountered: