unwatch files when removing them from the cache

This commit is contained in:
Konstantin Käfer
2011-07-13 21:58:11 +02:00
parent 1426060f44
commit 84509fd0dd

View File

@@ -83,6 +83,7 @@ MBTiles.prototype._open = function(uri) {
mbtiles._stat = stat;
fs.watchFile(mbtiles.filename, { interval: 1000 }, function(cur, prev) {
if (cur.mtime != prev.mtime) {
fs.unwatchFile(mbtiles.filename);
delete cache[uri.pathname];
}
});