django-health-check icon indicating copy to clipboard operation
django-health-check copied to clipboard

Improve configuration of default storage

Open ron8mcr opened this issue 1 year ago • 2 comments

Previously it was set using str with dotted path to storage, so StorageHealthCheck.get_storage initialize it on every call. This may lead to redundant calls to external APIs (see https://github.com/boto/boto3/issues/3614)

Meanwhile django.core.files.storage.default_storage is lazy object that can be safely used as class attribute, and single storage object may be reused

Also fixes #366

ron8mcr avatar Mar 17 '23 05:03 ron8mcr

@frankwiles Hello, can you please check this PR? Just curious about will I be able to use this feature soon

vanya909 avatar Sep 06 '23 02:09 vanya909

Hi @frankwiles, could you please take a loot at this one or at #408 or #383 ? Without this fix, django-health-check cannot be used with newer versions of Django (see https://docs.djangoproject.com/en/dev/releases/5.1/#features-removed-in-5-1)

ron8mcr avatar Mar 13 '24 01:03 ron8mcr