fleetmap-reports 1.0.279 → 1.0.281

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.279",
3
+ "version": "1.0.281",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -237,10 +237,14 @@ async function getCustomSpeedLimitEvents(devices, routes){
237
237
  async function getHereEvents(devices, routes, threshold){
238
238
  console.log('here speed limit events')
239
239
  const events = []
240
- const hereData = {}
241
- await Promise.all(devices.map(d =>
242
- here.routeMatch(routes.filter(p => p.deviceId === d.id)).then(r => d.results = r)
243
- ))
240
+ let i,j, temporary, chunk = 10;
241
+ for (i = 0,j = devices.length; i < j; i += chunk) {
242
+ temporary = devices.slice(i, i + chunk);
243
+ await Promise.all(temporary.map(d =>
244
+ here.routeMatch(routes.filter(p => p.deviceId === d.id)).then(r => d.results = r)
245
+ ))
246
+ }
247
+
244
248
  for (const d of devices) {
245
249
  try {
246
250
  const results = d.results