openverse-api
openverse-api copied to clipboard
Remove transition code in search controller
Problem
The code described in this snippet was transitionary and has served its utility. It should be removed. https://github.com/WordPress/openverse-api/blob/6cc0551c639081f895d974b30cc465713d0ce360/api/catalog/api/controllers/search_controller.py#L379-L387
Description
This cache invalidation snippet has definitely run in production and the caches have surely been migrated to the new format. This should no longer be a part of the codebase.
Alternatives
Even in the highly unlikely event that the caches have not been cleared and updated, a better solution would be to use try...except to handle invalid values rather than using a very specific transition state.
Implementation
- [ ] 🙋 I would be interested in implementing this feature.
Can we check the production cache to confirm this is safe?
@sarayourfriend given how long this has existed in the code, it's safe to assume this code has executed at least once, but yeah we can check the cache once and verify.