From c954f1d9105b089daefa96be49886893545fe365 Mon Sep 17 00:00:00 2001 From: gchoqueux Date: Mon, 10 Dec 2018 11:29:12 +0100 Subject: [PATCH] refactor(protocol): best place to layer wfs update state --- src/Process/FeatureProcessing.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Process/FeatureProcessing.js b/src/Process/FeatureProcessing.js index d3fb59bee3..95467bcc16 100644 --- a/src/Process/FeatureProcessing.js +++ b/src/Process/FeatureProcessing.js @@ -62,6 +62,16 @@ export default { return; } + if (node.layerUpdateState[layer.id] === undefined) { + node.layerUpdateState[layer.id] = new LayerUpdateState(); + } + + const ts = Date.now(); + + if (!node.layerUpdateState[layer.id].canTryUpdate(ts)) { + return; + } + const features = node.children.filter(n => n.layer == layer); if (features.length > 0) { @@ -80,16 +90,6 @@ export default { extentsSource.push(extentDest); } - if (node.layerUpdateState[layer.id] === undefined) { - node.layerUpdateState[layer.id] = new LayerUpdateState(); - } - - const ts = Date.now(); - - if (!node.layerUpdateState[layer.id].canTryUpdate(ts)) { - return; - } - node.layerUpdateState[layer.id].newTry(); const command = {