fleetmap-reports 2.0.237 → 2.0.238

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.237",
3
+ "version": "2.0.238",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -107,7 +107,8 @@ async function createZoneReport (from, to, userData, traccar) {
107
107
 
108
108
  const url = 'https://api.pinme.io/pinmeapi/process-report/zone-report-processing'
109
109
 
110
- const promises = sliced.map((slice, i) => simpleLimit(async () => {
110
+ const limit = simpleLimit(50)
111
+ const promises = sliced.map((slice, i) => limit(async () => {
111
112
  const now = new Date()
112
113
  return traccar.axios.post(url, {
113
114
  from,
@@ -125,7 +126,7 @@ async function createZoneReport (from, to, userData, traccar) {
125
126
  )
126
127
  const results = await Promise.all(promises)
127
128
  results.forEach(processed => {
128
- if (processed) {
129
+ if (processed && processed.length) {
129
130
  allData.devices.push(...processed)
130
131
  }
131
132
  })