Django's image admin view times out #5174
Labels
💻 aspect: code
Concerns the software code in the repository
🛠 goal: fix
Bug fix
🟧 priority: high
Stalls work on the project or its dependents
🧱 stack: api
Related to the Django API
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: