mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-16 21:30:23 +00:00
Remove "non-validating" backend
It's been superseded by the VALIDATE_ON_ACCESS setting
This commit is contained in:
parent
0fc29ee7cf
commit
3103ab29bd
2 changed files with 2 additions and 29 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from ..utils import get_singleton
|
||||
from .base import InvalidImageCacheBackendError, PessimisticImageCacheBackend, NonValidatingImageCacheBackend
|
||||
from .base import InvalidImageCacheBackendError, PessimisticImageCacheBackend
|
||||
|
||||
|
||||
def get_default_image_cache_backend():
|
||||
|
|
@ -9,4 +9,4 @@ def get_default_image_cache_backend():
|
|||
"""
|
||||
from django.conf import settings
|
||||
return get_singleton(settings.IMAGEKIT_DEFAULT_IMAGE_CACHE_BACKEND,
|
||||
'validation backend')
|
||||
'image cache backend')
|
||||
|
|
|
|||
|
|
@ -31,30 +31,3 @@ class PessimisticImageCacheBackend(object):
|
|||
|
||||
def clear(self, file):
|
||||
file.delete(save=False)
|
||||
|
||||
|
||||
class NonValidatingImageCacheBackend(object):
|
||||
"""
|
||||
A backend that is super optimistic about the existence of spec files. It
|
||||
will hit your file storage much less frequently than the pessimistic
|
||||
backend, but it is technically possible for a cache file to be missing
|
||||
after validation.
|
||||
|
||||
"""
|
||||
|
||||
def validate(self, file):
|
||||
"""
|
||||
NonValidatingImageCacheBackend has faith, so validate's a no-op.
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def invalidate(self, file):
|
||||
"""
|
||||
Immediately generate a new spec file upon invalidation.
|
||||
|
||||
"""
|
||||
file.generate(save=True)
|
||||
|
||||
def clear(self, file):
|
||||
file.delete(save=False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue