Skip to content

Commit 58b805c

Browse files
committed
retry to prepare concurrent build
1 parent 162ce60 commit 58b805c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

rescript

+12
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,18 @@ if (
498498
reasons_to_rebuild = [];
499499
LAST_BUILD_START = +Date.now();
500500
}
501+
// if acquiring lock failed, no need retry here
502+
// since build_finished_callback will try again
503+
// however this is no longer the case for multiple-process
504+
// it could fail due to other issues like .bsb.lock
505+
else {
506+
dlog(`Acquire lock failed, do the build later ${depth} : ${reasons_to_rebuild}`);
507+
var waitTime = Math.pow(2, depth) * 40;
508+
setTimeout(function () {
509+
var d = Math.min(depth + 1, 5);
510+
build(d);
511+
}, waitTime);
512+
}
501513
}
502514
/**
503515
*

0 commit comments

Comments
 (0)