Don't keep files in memory when not using cache

This commit is contained in:
2017-10-17 18:46:05 +02:00
parent 89bf2aba03
commit dfb21c3c46
+4 -2
View File
@@ -50,7 +50,8 @@ class Model:
#decorators with parameters:
def withResource(path, binary=False):
data = readfile(os.path.join(config.resourcedir, path), binary)
if config.cache:
data = readfile(os.path.join(config.resourcedir, path), binary)
def decorator(func):
def newfunc(*args, **kwargs):
@@ -67,7 +68,8 @@ def withResource(path, binary=False):
return decorator
def withTemplate(path, isHTML=True):
template = airspeed.Template(readfile(os.path.join(config.resourcedir, path)))
if config.cache:
template = airspeed.Template(readfile(os.path.join(config.resourcedir, path)))
def decorator(func):
def newfunc(*args, **kwargs):