fleetmap-reports 1.0.698 → 1.0.699

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zone-report.js +2 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.698",
3
+ "version": "1.0.699",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -15,7 +15,7 @@ const axios = require('axios')
15
15
  const { processServerSide } = require('./util')
16
16
  const { filterPositions } = require('./util/route')
17
17
  const { checkGeofenceIn } = require('./util/geofence')
18
- const sliceSize = 100
18
+ const sliceSize = 400
19
19
  const deviceChunk = 5
20
20
  const fileName = 'ZoneReport'
21
21
 
@@ -29,17 +29,7 @@ async function createZoneReport (from, to, userData, traccar) {
29
29
 
30
30
  if (processServerSide(userData)) {
31
31
  const url = `https://${process.env.SERVER_HOST}/reports/zone-report`
32
- const sliced = automaticReports.sliceArray(devices, sliceSize)
33
- const promises = []
34
- for (const slice of sliced) {
35
- promises.push(axios.post(url, { from, to, userData: { ...userData, devices: slice } }, { withCredentials: true })
36
- .then(d => d.data)
37
- .then(data => allData.devices.push(...(data[0].devices)))
38
- )
39
- }
40
- await Promise.all(promises)
41
- reportData.push(allData)
42
- return reportData
32
+ return axios.post(url, { from, to, userData }, { withCredentials: true }).then(d => d.data)
43
33
  }
44
34
  const types = ['geofenceEnter', 'geofenceExit']
45
35