From 84509fd0dd8f1796a1fd755c6473ca3320496556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 13 Jul 2011 21:58:11 +0200 Subject: [PATCH] unwatch files when removing them from the cache --- lib/mbtiles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/mbtiles.js b/lib/mbtiles.js index f0fc03b..a0b98d5 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -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]; } });