fleetmap-reports 1.0.871 → 1.0.873
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/speeding-report.js +5 -2
package/package.json
CHANGED
package/src/speeding-report.js
CHANGED
|
@@ -318,11 +318,13 @@ async function getRoadSpeedLimits (devices, routes, threshold, minimumMinutes =
|
|
|
318
318
|
async function invokeValhalla (route, i, chunk, country, threshold, results, retry = 3) {
|
|
319
319
|
const slice = route.slice(i, i + chunk)
|
|
320
320
|
try {
|
|
321
|
+
const url = `http://valhalla-${getCountry(slice[0]) || country}.pinme.io:8002/trace_attributes`
|
|
322
|
+
console.log(url)
|
|
321
323
|
const {
|
|
322
324
|
// eslint-disable-next-line camelcase
|
|
323
325
|
matched_points,
|
|
324
326
|
edges
|
|
325
|
-
} = await axios.post(
|
|
327
|
+
} = await axios.post(url,
|
|
326
328
|
{
|
|
327
329
|
costing: 'auto',
|
|
328
330
|
shape_match: 'map_snap',
|
|
@@ -345,7 +347,7 @@ async function invokeValhalla (route, i, chunk, country, threshold, results, ret
|
|
|
345
347
|
lon: p.longitude,
|
|
346
348
|
lat: p.latitude
|
|
347
349
|
}))
|
|
348
|
-
})
|
|
350
|
+
}, { timeout: 10000 })
|
|
349
351
|
.then(r => r.data)
|
|
350
352
|
// eslint-disable-next-line camelcase
|
|
351
353
|
matched_points.forEach((mp, mIndex) => {
|
|
@@ -357,6 +359,7 @@ async function invokeValhalla (route, i, chunk, country, threshold, results, ret
|
|
|
357
359
|
})
|
|
358
360
|
} catch (e) {
|
|
359
361
|
if (--retry) {
|
|
362
|
+
console.log(e.message, 'retry:', retry)
|
|
360
363
|
return invokeValhalla(route, i, chunk, country, threshold, results, retry)
|
|
361
364
|
} else {
|
|
362
365
|
console.error(e.message, e.response && e.response.data, slice[0])
|