fleetmap-reports 1.0.672 → 1.0.673

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.672",
3
+ "version": "1.0.673",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -8,9 +8,10 @@ describe('zones', function () {
8
8
  console.log(userData.devices.length)
9
9
  userData.geofences = userData.geofences.filter(g => g.name === 'Geofence Ellca')
10
10
  console.log(userData.geofences)
11
- await report.zoneReport(
11
+ const result = await report.zoneReport(
12
12
  new Date(Date.UTC(2022, 6, 24, 0, 0, 0, 0)),
13
13
  new Date(Date.UTC(2022, 6, 25, 23, 59, 59, 0)),
14
14
  userData)
15
- }, 400000)
15
+ console.log('result', result)
16
+ }, 4000000)
16
17
  })
@@ -108,7 +108,9 @@ async function getAllInOne (
108
108
  return x
109
109
  }))
110
110
  }
111
+ const now = new Date()
111
112
  result.push(...(await Promise.all(requests)))
113
+ console.log('took', new Date() - now, 'ms')
112
114
  }
113
115
  return {
114
116
  route: result.filter(t => t.route).map(r => r.route).flat(),
@@ -18,7 +18,7 @@ const distance = require('@turf/distance')
18
18
  const axios = require('axios')
19
19
  const { processServerSide } = require('./util')
20
20
  const { filterPositions } = require('./util/route')
21
- const sliceSize = 2
21
+ const sliceSize = 10
22
22
  const deviceChunk = 2
23
23
  const fileName = 'ZoneReport'
24
24