Skip to content

Commit

Permalink
Close old db connections after getting thumbnails (#5335)
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal authored Jan 14, 2025
1 parent ca08b5c commit f41f20d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/api/utils/image_proxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from urllib.parse import urlparse

from django.conf import settings
from django.db import close_old_connections
from django.http import HttpResponse
from rest_framework.exceptions import UnsupportedMediaType

Expand Down Expand Up @@ -297,3 +298,5 @@ async def get(
)

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

0 comments on commit f41f20d

Please sign in to comment.