Skip to content

Commit

Permalink
Fixing swig cache
Browse files Browse the repository at this point in the history
If `options.cache === true`, swig expects the value returned to be `'memory'`, otherwise an error is thrown.
  • Loading branch information
jonlong committed Feb 15, 2014
1 parent 55e26c0 commit bf95a02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/hooks/views/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ module.exports = function(sailsAppPath) {
fns.swig.render = function(str, options, fn){
var engine = requires.swig || (requires.swig = require(sailsAppPath + '/swig'));
try {
if(options.cache === true) options.cache = 'memory';
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
Expand Down

0 comments on commit bf95a02

Please sign in to comment.