Comparing version 0.0.6 to 0.0.7
@@ -58,13 +58,17 @@ var Q = require('kew') | ||
var key = keys[i] | ||
var keyClients = clients[key] | ||
var promise = undefined | ||
if (!key) { | ||
promises.push(undefined) | ||
} else { | ||
var keyClients = clients[key] | ||
var promise = undefined | ||
for (j = 0; j < keyClients.length; j++) { | ||
// for every client available to this | ||
promise = chainGetPromise(promise, key, keyClients[j]) | ||
for (j = 0; j < keyClients.length; j++) { | ||
// for every client available to this | ||
promise = chainGetPromise(promise, key, keyClients[j]) | ||
} | ||
promises.push(promise ? promise.fail(onError).then(function (data) { | ||
return data | ||
}) : undefined) | ||
} | ||
promises.push(promise ? promise.fail(onError).then(function (data) { | ||
return data | ||
}) : undefined) | ||
} | ||
@@ -71,0 +75,0 @@ |
{ | ||
"name": "zcache" | ||
, "description": "AWS zone-aware caching" | ||
, "version": "0.0.6" | ||
, "version": "0.0.7" | ||
, "homepage": "https://github.com/azulus/zcache" | ||
@@ -6,0 +6,0 @@ , "authors": [ |
@@ -35,7 +35,7 @@ var CacheCluster = require('../lib/CacheCluster') | ||
currentVal++ | ||
console.log('setting', currentVal) | ||
//console.log('setting', currentVal) | ||
return cacheManager.set('testKey', currentVal) | ||
} | ||
var getVal = function () { | ||
console.log('getting', currentVal) | ||
//console.log('getting', currentVal) | ||
return cacheManager.get('testKey') | ||
@@ -49,3 +49,3 @@ } | ||
test.equal(val, currentVal, "Val should be correct") | ||
if (currentVal <= 10000) { | ||
if (currentVal <= 1000) { | ||
var defer = Q.defer() | ||
@@ -52,0 +52,0 @@ process.nextTick(function () { |
@@ -9,2 +9,36 @@ var CacheCluster = require('../lib/CacheCluster') | ||
}) | ||
exports.testInvalidKey = function (test) { | ||
var cacheManager = new CacheManager() | ||
var primaryCluster = new CacheCluster({ | ||
clientCtor: FakeMemcache | ||
}) | ||
primaryCluster.setServerCapacity('localhost:11212', 100) | ||
primaryCluster.setServerCapacity('localhost:11213', 100 ) | ||
cacheManager.addCluster('primary', primaryCluster, 1) | ||
var secondaryCluster = new CacheCluster({ | ||
clientCtor: FakeMemcache | ||
}) | ||
secondaryCluster.setServerCapacity('localhost:11214', 100) | ||
secondaryCluster.setServerCapacity('localhost:11215', 100) | ||
cacheManager.addCluster('secondary', secondaryCluster, 2) | ||
cacheManager.set("a", "123") | ||
.then(function () { | ||
return cacheManager.get(undefined) | ||
}) | ||
.then(function (data) { | ||
test.equal(data, undefined, "Response should be undefined") | ||
return cacheManager.mget([undefined, null, "a"]) | ||
}) | ||
.then(function (data) { | ||
test.equal(data[0], undefined, "Response[0] should be undefined") | ||
test.equal(data[1], undefined, "Response[1] should be undefined") | ||
test.equal(data[2], "123", "Response[2] should be 123") | ||
test.done() | ||
}) | ||
} | ||
exports.testManager = function (test) { | ||
@@ -11,0 +45,0 @@ var cacheManager = new CacheManager() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45521
831