Skip to content

Commit

Permalink
refactor(protocol): best place to layer wfs update state
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Dec 14, 2018
1 parent a5169c9 commit c954f1d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Process/FeatureProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 = {
Expand Down

0 comments on commit c954f1d

Please sign in to comment.