Ensures all old connections are closed in certain longer running locations (#4265)

This commit is contained in:
Trenton H
2023-09-25 12:52:22 -07:00
committed by GitHub
parent f217f034d0
commit 7291f11be7
2 changed files with 8 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ from time import monotonic
from time import sleep
from typing import Final
from django import db
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
@@ -38,6 +39,7 @@ def _tags_from_path(filepath) -> set[Tag]:
Returns set of Tag models
"""
db.close_old_connections()
tag_ids = set()
path_parts = Path(filepath).relative_to(settings.CONSUMPTION_DIR).parent.parts
for part in path_parts: