fleetmap-reports 2.0.234 → 2.0.236

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.234",
3
+ "version": "2.0.236",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -25,8 +25,6 @@ const axios = require('axios').default
25
25
  const sliceSize = 1
26
26
  const deviceChunk = 5
27
27
  const fileName = 'ZoneReport'
28
- import pLimit from 'p-limit'
29
- const limit = pLimit(50)
30
28
 
31
29
  exports.process = async (traccar, from, to, slice, deviceCount, devices, reportRangeDays, userData) => {
32
30
  const data = await traccarHelper.getAllInOne(
@@ -87,6 +85,8 @@ async function createZoneReport (from, to, userData, traccar) {
87
85
 
88
86
  const url = 'https://api.pinme.io/pinmeapi/process-report/zone-report-processing'
89
87
 
88
+ const pLimit = (await import('p-limit')).default
89
+ const limit = pLimit(50)
90
90
  const promises = sliced.map((slice, i) => limit(async () => {
91
91
  const now = new Date()
92
92
  return traccar.axios.post(url, {