Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make cache reusable

  • Loading branch information...
commit fdac85910e4a129d30e2497dc23ae12073c9e14f 1 parent 437cc95
John Lindal authored
Showing with 9 additions and 9 deletions.
  1. +1 −1  TODO
  2. +1 −1  combo.js
  3. +7 −7 server/cache.js
View
2  TODO
@@ -5,7 +5,7 @@ npm modules
optimize dependency loading via nodejs:
configure versions on the server
call function that does Y.Loader.resolve() to return complete list of deps
- memoized, so the result is cached
+ store in info.json
also provide function to generate loader config
View
2  combo.js
@@ -95,7 +95,7 @@ require('./server/yui-log-filter.js').installFilter(Y, log_levels);
if (argv.cache)
{
- var response_cache = require('./server/cache.js').init(Y, argv);
+ var response_cache = require('./server/cache.js').create(Y, argv.cache, argv['cache-log'], argv['cache-log-interval']);
var cache_key_pending = {};
}
View
14 server/cache.js
@@ -8,10 +8,10 @@
var mod_fs = require('fs');
-exports.init = function(Y, argv)
+exports.create = function(Y, size, path, interval)
{
- var size = parseInt(argv.cache, 10) || 500;
- Y.log('cache size: ' + size + 'MB', 'debug', 'combo');
+ var size = parseInt(size, 10) || 500;
+ Y.log('cache size: ' + size + 'MB', 'info', 'combo');
function cacheMetric(value)
{
@@ -49,13 +49,13 @@ exports.init = function(Y, argv)
});
}
- if (argv['cache-log'])
+ if (path)
{
- Y.log('dumping cache stats every ' + argv['cache-log-interval'] + ' hours', 'debug', 'combo');
+ Y.log('dumping cache stats every ' + interval + ' hours', 'info', 'combo');
- var cache_log_dump_prefix = argv['cache-log'] + '/dump-';
+ var cache_log_dump_prefix = path + '/dump-';
- var cache_log_dump_interval = parseFloat(argv['cache-log-interval']);
+ var cache_log_dump_interval = parseFloat(interval);
var cache_log_dump_format = '%Y-%m-%d-%H-%M';
if (cache_log_dump_interval >= 1)
{
Please sign in to comment.
Something went wrong with that request. Please try again.