fleetmap-reports 2.0.198 → 2.0.200

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": "2.0.198",
3
+ "version": "2.0.200",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -37,7 +37,7 @@ exports.parallel = (report, method, toSlice, ...args) => {
37
37
  resolve(_result.flat())
38
38
  }
39
39
  })
40
- worker.on('error', e => {console.error(e); reject(e)})
40
+ worker.on('error', e => { console.error(e); reject(e) })
41
41
  worker.on('exit', (code, signal) => {
42
42
  if (code !== 0) {
43
43
  const error = `Worker exited with code ${code} and signal ${signal}`
@@ -93,6 +93,7 @@ async function getItems (traccar, u, _chunk, counter, devicesPerRequest, ignoreP
93
93
  }
94
94
 
95
95
  async function streamJson (traccar, u) {
96
+ console.log('streaming', u)
96
97
  const response = await traccar.axios.get(u, {
97
98
  responseType: 'stream',
98
99
  jar: traccar.cookieJar,
@@ -114,6 +115,7 @@ async function streamJson (traccar, u) {
114
115
 
115
116
  pipeline.on('data', ({ value }) => {
116
117
  result.route.push(value) // Or stream to a DB/file/processor
118
+ console.log('pushed to', result.route.length)
117
119
  })
118
120
  pipeline.on('end', () => resolve(result))
119
121
  pipeline.on('error', reject)
@@ -27,6 +27,7 @@ const sliceSize = 4
27
27
  const fileName = 'ZoneReport'
28
28
 
29
29
  async function createZoneReport (from, to, userData, traccar) {
30
+ console.log('createZoneReport 200', from, to)
30
31
  const reportData = []
31
32
  const devices = devicesToProcess(userData)
32
33
  const allData = {