From a8b7c180f7d9c26b6b7a3669492549f34cf79d34 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 30 Apr 2018 17:12:22 -0700 Subject: [PATCH] Expire fault when original task expires --- lib/cwmp.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cwmp.coffee b/lib/cwmp.coffee index 0e2d3d9..20b9734 100644 --- a/lib/cwmp.coffee +++ b/lib/cwmp.coffee @@ -120,6 +120,10 @@ recordFault = (sessionContext, fault, provisions, channels) -> for channel of channels provs = sessionContext.faults[channel]?.provisions or [] faults[channel] = Object.assign({provisions: provs}, fault) + if channel.startsWith('task_') + taskId = channel.slice(5) + for t in sessionContext.tasks + faults[channel].expiry = t.expiry if t._id == taskId and t.expiry if sessionContext.retries[channel]? ++ sessionContext.retries[channel]