Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Fix the cache condition (#3516)

Olga Bulat7e87b6734809
diff --git a/api/api/controllers/search_controller.py b/api/api/controllers/search_controller.py
index ac18488d0..f84cfc272 100644
--- a/api/api/controllers/search_controller.py
+++ b/api/api/controllers/search_controller.py
@@ -570,7 +570,7 @@ def get_sources(index):
if isinstance(sources, list) or cache_fetch_failed:
# Invalidate old provider format.
cache.delete(key=source_cache_name)
- if not sources or sources:
+ if not sources:
# Don't increase `size` without reading this issue first:
# https://github.com/elastic/elasticsearch/issues/18838
size = 100