diff --git a/lib/mbtiles.js b/lib/mbtiles.js index 2f1ccda..90be990 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -93,7 +93,12 @@ MBTiles.prototype._open = function(uri) { }, function(err, info) { if (err) return error(err); mbtiles._info = info; - fs.watchFile(mbtiles.filename, { interval: 1000 }, function(cur, prev) { + fs.watchFile(mbtiles.filename, { + // Indicates that the node process may exit if the file watcher + // is the only thing in the event loop. + persistent: false, + interval: 1000 + }, function(cur, prev) { if (cur.mtime != prev.mtime) { fs.unwatchFile(mbtiles.filename); delete cache[key];