mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-05-04 11:24:43 +00:00
parent
ada883c99f
commit
637af70921
1 changed files with 8 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from ..utils import get_singleton, sanitize_cache_key
|
||||
from copy import copy
|
||||
from django.core.cache import get_cache
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
|
|
@ -76,6 +77,13 @@ class CachedFileBackend(object):
|
|||
else:
|
||||
self.cache.set(key, state)
|
||||
|
||||
def __getstate__(self):
|
||||
state = copy(self.__dict__)
|
||||
# Don't include the cache when pickling. It'll be reconstituted based
|
||||
# on the settings.
|
||||
state.pop('_cache', None)
|
||||
return state
|
||||
|
||||
def exists(self, file):
|
||||
return self.get_state(file) is CacheFileState.EXISTS
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue