@golemio/pid 2.3.3-dev.675443336 → 2.3.3-dev.676525380

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.
@@ -98,10 +98,12 @@ AS $procedure$
98
98
  declare
99
99
  idsForDelete varchar(255)[];
100
100
  begin
101
- select array_agg(t.id) from pid.vehiclepositions_trips t
102
- left join pid.vehiclepositions_positions p on
103
- p.id = t.last_position_id
104
- where TO_TIMESTAMP(p.valid_to/1000) < (NOW() - '15 minutes'::interval)
101
+ select array_agg(t.id) from pid.vehiclepositions_trips t
102
+ left join pid.vehiclepositions_positions p on
103
+ p.id = t.last_position_id
104
+ where
105
+ p.valid_to/1000 < extract(epoch from (NOW() - '15 minutes'::interval))
106
+ or (gtfs_trip_id is null and p.created_at < NOW() - '15 minutes'::interval) -- entries with valid to is null
105
107
  into idsForDelete;
106
108
 
107
109
  INSERT INTO pid.vehiclepositions_trips_history
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/pid",
3
- "version": "2.3.3-dev.675443336",
3
+ "version": "2.3.3-dev.676525380",
4
4
  "description": "Golemio PID Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",