memcache-plus
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -304,4 +304,11 @@ /** | ||
if (ttl > 0) { | ||
// We use ceil() here because we need the result to be greater than | ||
// 0 since 0 means no expiration. | ||
ttl = Math.ceil(ttl/1000); | ||
} | ||
// First send the metadata for this request | ||
this.write(util.format('set %s 0 %d %d', key, ttl, v.length)); | ||
// Then the actual value | ||
@@ -308,0 +315,0 @@ this.write(v); |
{ | ||
"name": "memcache-plus", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Better memcache for node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -429,2 +429,23 @@ require('chai').should(); | ||
}); | ||
describe('works with expiration', function() { | ||
it('expires', function() { | ||
var key = getKey(), val = chance.word(); | ||
return cache.set(key, val, 500) | ||
.then(function() { | ||
return cache.get(key); | ||
}) | ||
.then(function(v) { | ||
val.should.equal(v); | ||
}) | ||
.delay(1000) | ||
.then(function() { | ||
return cache.get(key); | ||
}) | ||
.then(function(v) { | ||
expect(v).to.be.null; | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -431,0 +452,0 @@ // @todo should have cleanup jobs to delete keys we set in memcache |
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
53745
1276