@transportme/load-ptv-gtfs 1.3.7 → 1.3.8

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.
@@ -8,7 +8,7 @@ import { TRANSIT_MODES } from '../constants.mjs'
8
8
  *
9
9
  * @param {DatabaseConnection} database The database connection to use
10
10
  */
11
- export default async function setRouteStops(database, directionsMap) {
11
+ export default async function setRouteStops(database, directionsMap, onMilestone = () => {}) {
12
12
  let gtfsTimetables = database.getCollection('gtfs timetables')
13
13
  let routes = database.getCollection('routes')
14
14
 
@@ -16,6 +16,7 @@ export default async function setRouteStops(database, directionsMap) {
16
16
 
17
17
  let stopsByService = {}
18
18
 
19
+ let count = 0
19
20
  await async.forEachLimit(allRoutes, 100, async routeGTFSID => {
20
21
  let routeData = await routes.findDocument({ routeGTFSID })
21
22
  let routeVariants = routeData.routePath.map(variant => ({ shapeID: variant.fullGTFSIDs[0], routeGTFSID }))
@@ -78,6 +79,8 @@ export default async function setRouteStops(database, directionsMap) {
78
79
  stopsByService[routeGTFSID][gtfsDirection].trainDirection = isUp ? 'Up' : 'Down'
79
80
  }
80
81
  }
82
+
83
+ if (++count % 25 === 0) onMilestone(count, total)
81
84
  })
82
85
 
83
86
  let bulkOperations = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/load-ptv-gtfs",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "scripts": {