From 18fdb747beb68b9d0d26c648d4ea681c48dc91b9 Mon Sep 17 00:00:00 2001 From: Mathew Date: Wed, 13 Sep 2023 19:39:13 +1000 Subject: [PATCH] handle src rtg changing --- lib/Af.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Af.js b/lib/Af.js index aa0c549..b8c2b96 100644 --- a/lib/Af.js +++ b/lib/Af.js @@ -328,8 +328,14 @@ class Af extends EventEmitter { } catch(ex){ if(ex.status == 178) { // ZApsTableFull wf.cancel() - await Q.delay(Math.random() + 0.5 * 16000) - areqCancelable.delete(wf) + areqCancelable._cancels.delete(wf) + await Q.delay((Math.random() + 0.5) * 16000) + + // in case the src rtg changed + const srcRtg = dstEp.getSrcRtg() + if(!srcRtg) break; + Object.assign(newAfParams, Af.buildAfSrcRtg(srcRtg)) + continue } else { throw ex @@ -351,8 +357,8 @@ class Af extends EventEmitter { } catch(ex){ if(ex.status == 178) { // ZApsTableFull wf.cancel() - await Q.delay(Math.random() + 0.5 * 16000) - areqCancelable.delete(wf) + areqCancelable._cancels.delete(wf) + await Q.delay((Math.random() + 0.5) * 16000) continue } else { throw ex