-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix LockingCache expiry behaviour. #44 #57
Conversation
… cache for the specified timeout rather than until initial callbacks happen
hmm, just found #16 |
…apnik use it like that
ok, updated request special-cases I can't find anything else that uses lockingcache, but I'm happy to revise further if it helps. |
@kkaefer yeah, and timeout=0 maintains that behaviour (and that's what |
@rcoup - thanks for the patch. reviewing now, but seeing:
|
@rcoup - running this inside the tilelive-mapnik master directory hangs: var assert = require('assert')
var tilelive = require('./lib/mapnik_backend');
var coords = [0,0,0];
var uri = 'mapnik://./test/data/invalid_interactivity_1.xml'
var ddd = new tilelive(uri, function(err, source) {
if (err) throw err;
source.getGrid(coords[0], coords[1], coords[2], function(err, tile, headers) {
// never gets here, just hangs with patch from #57
assert.ok(err);
source.close(function(){});
console.log('worked!')
})
}); |
…Don't set a 0-timeout. More error tests
Okay, thanks, all tests passing for me now. I will merge since this maintains the current behavior. Next up I think we need to 1) move tests to mocha to ensure we are more able to catch possible bugs, and 2) potentially expose options to control the locking cache behavior by options passed to the MapnikSource constructor. |
Make the LockingCache expiry behavior configurable. #44
Fix #44, make the cache actually cache for the specified timeout rather than until initial callbacks happen.
Also adds some tests around LockingCache.