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 +1 -1
- package/src/tests/zones.test.js +3 -2
- package/src/util/traccar.js +2 -0
- package/src/zone-report.js +1 -1
package/package.json
CHANGED
package/src/tests/zones.test.js
CHANGED
|
@@ -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
|
-
|
|
15
|
+
console.log('result', result)
|
|
16
|
+
}, 4000000)
|
|
16
17
|
})
|
package/src/util/traccar.js
CHANGED
|
@@ -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(),
|
package/src/zone-report.js
CHANGED
|
@@ -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 =
|
|
21
|
+
const sliceSize = 10
|
|
22
22
|
const deviceChunk = 2
|
|
23
23
|
const fileName = 'ZoneReport'
|
|
24
24
|
|