Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Close old db connections after getting thumbnails (#5335)
Krystle Salazarf41f20d27615
diff --git a/api/api/utils/image_proxy/__init__.py b/api/api/utils/image_proxy/__init__.pyindex 5f3be6906..d130bfd22 100644--- a/api/api/utils/image_proxy/__init__.py+++ b/api/api/utils/image_proxy/__init__.py@@ -3,6 +3,7 @@ from typing import Literalfrom urllib.parse import urlparsefrom django.conf import settings+from django.db import close_old_connectionsfrom django.http import HttpResponsefrom rest_framework.exceptions import UnsupportedMediaType@@ -297,3 +298,5 @@ async def get()raise UpstreamThumbnailException(f"Failed to render thumbnail. {exc}")+ finally:+ close_old_connections()