From 54af46c25ab84b2e87d60ca4773af7bf96c465f4 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Wed, 20 Oct 2021 12:12:13 -0400 Subject: [PATCH] Wait for an existing forge before a new reforge --- utils/GunSmith/GunSmith.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/utils/GunSmith/GunSmith.js b/utils/GunSmith/GunSmith.js index b7759e58..235393c2 100644 --- a/utils/GunSmith/GunSmith.js +++ b/utils/GunSmith/GunSmith.js @@ -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 }