Use persistent:false on watchFile to allow tests to exit.
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user