fleetmap-reports 1.0.493 → 1.0.495

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.493",
3
+ "version": "1.0.495",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -106,7 +106,7 @@ async function createSpeedingReportByDriver (from, to, userData, traccarInstance
106
106
  const sliced = automaticReports.sliceArray(devices, 10)
107
107
  let deviceCount = 0
108
108
  for (const slice of sliced) {
109
- const { routes, events } = await getEvents(traccarInstance, from, to, devices, userData, deviceCount, devices.length, slice.length)
109
+ const { routes, events } = await getEvents(traccarInstance, from, to, slice, userData, deviceCount, devices.length, slice.length)
110
110
  if (processServerSide()) {
111
111
  console.log('LOADING_MESSAGE:' + slice[0].name)
112
112
  console.log(`PROGRESS_PERC:${deviceCount / devices.length * 100}`)
@@ -298,7 +298,7 @@ async function getCustomSpeedLimitEvents (devices, routes, customSpeed) {
298
298
 
299
299
  async function getHereEvents (devices, routes, threshold) {
300
300
  try {
301
- console.log('env', process.env.PROCESS_HERE_EVENTS)
301
+ console.log('PROCESS_HERE_EVENTS', process.env.PROCESS_HERE_EVENTS)
302
302
  console.log('here speed limit events', devices.length, 'devices')
303
303
  const events = []
304
304
  const promises = devices.map(d => new Promise((resolve) => {
@@ -331,11 +331,13 @@ async function getHereEvents (devices, routes, threshold) {
331
331
  if (!reduced.length) {
332
332
  console.log('empty array after filter on device', d.name)
333
333
  resolve()
334
+ } else {
335
+ console.log(d.name, 'reduced to', reduced.length)
334
336
  }
335
337
  events.push(...reduced)
336
338
  resolve()
337
339
  }).catch(e => {
338
- console.error('error on route match, moving on', e)
340
+ console.error('error on route match, moving on', e.message)
339
341
  resolve()
340
342
  })
341
343
  }))