Wait for an existing forge before a new reforge

This commit is contained in:
Daniel Lugo 2021-10-20 12:12:13 -04:00
parent 93533660bd
commit 54af46c25a

View file

@ -558,8 +558,10 @@ function createReplica(path, afterMap = false) {
const checkCanary = () =>
setTimeout(() => {
if (!canaryPeep) {
forge()
isReady().then(checkCanary)
isReady()
.then(forge)
.then(isReady)
.then(checkCanary)
}
}, 30000)
@ -575,10 +577,12 @@ function createReplica(path, afterMap = false) {
if (isPopulated(data) || _wait > 100000) {
cb(data, key)
} else {
forge()
isReady().then(() => {
this.specialOnce(cb, _wait * 3)
})
isReady()
.then(forge)
.then(isReady)
.then(() => {
this.specialOnce(cb, _wait * 3)
})
}
},
{ wait: _wait }