Use persistent:false on watchFile to allow tests to exit.

This commit is contained in:
Young Hahn
2011-10-31 02:40:47 -04:00
parent 9f97bbb095
commit 7d430f77e5

View File

@@ -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];