Commit 4efc5d47 authored by John Crepezzi's avatar John Crepezzi
Browse files

Allow redistogo

parent ff8ef54e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -8,9 +8,11 @@ var winston = require('winston');
// options[db] - The db to use (default 0)
// options[expire] - The time to live for each key set (default never)

var RedisDocumentStore = function(options) {
var RedisDocumentStore = function(options, client) {
  this.expire = options.expire;
  if (!RedisDocumentStore.client) {
  if (client) {
    RedisDocumentStore.client = client;
  } else if (!RedisDocumentStore.client) {
    RedisDocumentStore.connect(options);
  }
};
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
  "dependencies": {
    "winston": "0.6.2",
    "connect": "1.9.2",
    "redis-url": "0.1.0",
    "uglify-js": "1.3.3"
  },
  "devDependencies": {
+11 −2
Original line number Diff line number Diff line
@@ -34,8 +34,17 @@ if (!config.storage) {
if (!config.storage.type) {
  config.storage.type = 'file';
}
var Store = require('./lib/document_stores/' + config.storage.type);
var preferredStore = new Store(config.storage);

var Store, preferredStore;
if (config.storage.type === 'redistogo') {
  var redisClient = require('redis-url').connect(process.env.REDISTOGO_URL);
  Store = require('./lib/document_stores/redis');
  preferredStore = new Store(config.storage, redisClient);
}
else {
  Store = require('./lib/document_stores/' + config.storage.type);
  preferredStore = new Store(config.storage);
}

// Compress the static javascript assets
if (config.recompressStaticAssets) {