Remove cached bundle if update fails

Summary: If a bundle failed to build, a file change would trigger the *update bundle* path, without ever being able to resolve the bundle. If a bundle can't be updated, we evict it from the cache.

Reviewed By: cpojer

Differential Revision: D3726567

fbshipit-source-id: a342f00c5a41364551194c33082718e5483fd7a4
This commit is contained in:
David Aurelio 2016-08-16 17:39:34 -07:00 committed by Facebook Github Bot 7
parent 9e20146f7f
commit a5a087ef44
1 changed files with 3 additions and 0 deletions

View File

@ -252,6 +252,9 @@ class Server {
deps.outdated.add(filePath);
}
});
}).catch(e => {
debug(`Could not update bundle: ${e}, evicting from cache`);
delete this._bundles[key];
});
}
} else {