提交 1db12a0c 编写于 作者: J Joao Moreno

implement retry in rimraf

上级 e50fe199
......@@ -241,7 +241,19 @@ exports.loadSourcemaps = () => {
return es.duplex(input, output);
};
exports.rimraf = dir => cb => rimraf(dir, { maxBusyTries: 1 }, cb);
exports.rimraf = dir => {
let retries = 0;
const retry = cb => {
rimraf(dir, { maxBusyTries: 1 }, err => {
if (!err) return cb();
if (err.code === 'ENOTEMPTY' && ++retries < 5) return setTimeout(() => retry(cb), 10);
else return cb(err);
});
};
return cb => retry(cb);
};
exports.getVersion = root => {
let version = process.env['BUILD_SOURCEVERSION'];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册