Skip to content

Commit f41f20d

Browse files
authored
Close old db connections after getting thumbnails (#5335)
1 parent ca08b5c commit f41f20d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/api/utils/image_proxy/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from urllib.parse import urlparse
44

55
from django.conf import settings
6+
from django.db import close_old_connections
67
from django.http import HttpResponse
78
from rest_framework.exceptions import UnsupportedMediaType
89

@@ -297,3 +298,5 @@ async def get(
297298
)
298299

299300
raise UpstreamThumbnailException(f"Failed to render thumbnail. {exc}")
301+
finally:
302+
close_old_connections()

0 commit comments

Comments
 (0)