@golemio/pid 2.22.1-dev.1484704340 → 2.22.1-dev.1484821938

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,8 +10,10 @@ class PositionStateDelayManager {
10
10
  if (context && context.lastPositionState !== const_1.StatePositionEnum.AFTER_TRACK && context.lastPositionStateChange) {
11
11
  const nowTimestamp = new Date().getTime();
12
12
  const stateChangedTimestamp = new Date(context.lastPositionStateChange).getTime();
13
- // if state was changed in the last 30 seconds, then it is allowed to propagate delay
14
- return nowTimestamp - stateChangedTimestamp <= 30 * 1000;
13
+ // state was changed in the last 30 seconds, then it is allowed to propagate delay
14
+ return context.lastPositionState === const_1.StatePositionEnum.AFTER_TRACK_DELAYED
15
+ ? nowTimestamp - stateChangedTimestamp <= 30 * 1000
16
+ : true;
15
17
  }
16
18
  return false;
17
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PositionStateDelayManager.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/state-position/PositionStateDelayManager.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAE9C,MAAa,yBAAyB;IAClC;;OAEG;IACI,MAAM,CAAC,8BAA8B,CAAC,OAA2C;QACpF,IAAI,OAAO,IAAI,OAAO,CAAC,iBAAiB,KAAK,yBAAiB,CAAC,WAAW,IAAI,OAAO,CAAC,uBAAuB,EAAE;YAC3G,MAAM,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YAC1C,MAAM,qBAAqB,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,EAAE,CAAC;YAElF,qFAAqF;YACrF,OAAO,YAAY,GAAG,qBAAqB,IAAI,EAAE,GAAG,IAAI,CAAC;SAC5D;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAfD,8DAeC"}
1
+ {"version":3,"file":"PositionStateDelayManager.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/state-position/PositionStateDelayManager.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAE9C,MAAa,yBAAyB;IAClC;;OAEG;IACI,MAAM,CAAC,8BAA8B,CAAC,OAA2C;QACpF,IAAI,OAAO,IAAI,OAAO,CAAC,iBAAiB,KAAK,yBAAiB,CAAC,WAAW,IAAI,OAAO,CAAC,uBAAuB,EAAE;YAC3G,MAAM,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YAC1C,MAAM,qBAAqB,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,EAAE,CAAC;YAElF,kFAAkF;YAClF,OAAO,OAAO,CAAC,iBAAiB,KAAK,yBAAiB,CAAC,mBAAmB;gBACtE,CAAC,CAAC,YAAY,GAAG,qBAAqB,IAAI,EAAE,GAAG,IAAI;gBACnD,CAAC,CAAC,IAAI,CAAC;SACd;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAjBD,8DAiBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/pid",
3
- "version": "2.22.1-dev.1484704340",
3
+ "version": "2.22.1-dev.1484821938",
4
4
  "description": "Golemio PID Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",