Use persistent:false on watchFile to allow tests to exit.
This commit is contained in:
+6
-1
@@ -93,7 +93,12 @@ MBTiles.prototype._open = function(uri) {
|
|||||||
}, function(err, info) {
|
}, function(err, info) {
|
||||||
if (err) return error(err);
|
if (err) return error(err);
|
||||||
mbtiles._info = info;
|
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) {
|
if (cur.mtime != prev.mtime) {
|
||||||
fs.unwatchFile(mbtiles.filename);
|
fs.unwatchFile(mbtiles.filename);
|
||||||
delete cache[key];
|
delete cache[key];
|
||||||
|
|||||||
Reference in New Issue
Block a user