Only instantiate the STORAGE once per interpreter

This commit is contained in:
Gert Van Gool
2010-06-29 18:35:34 +08:00
committed by Jannis Leidel
parent d4d6c576c5
commit 5d6e5d9156

View File

@@ -11,6 +11,8 @@ from compressor import filters
from compressor.exceptions import UncompressableFileError
from compressor.utils import get_hexdigest, get_mtime, get_class
STORAGE = get_storage_class(settings.STORAGE)()
class Compressor(object):
def __init__(self, content, output_prefix="compressed"):
@@ -55,7 +57,7 @@ class Compressor(object):
@property
def storage(self):
return get_storage_class(settings.STORAGE)()
return STORAGE
@property
def hunks(self):