Purge cache partition before deleting them

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-07-26 01:33:14 -04:00
parent ff6674cc4a
commit c2e99e6efb

View File

@@ -167,6 +167,10 @@ class CachePartition(models.Model):
logger.debug('unable to obtain lock: %s' % lock_id)
raise
def delete(self, *args, **kwargs):
self.purge()
return super(CachePartition, self).delete(*args, **kwargs)
def get_file(self, filename):
try:
return self.files.get(filename=filename)