fleetmap-reports 1.0.712 → 1.0.714
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
package/src/tests/fuel.test.js
CHANGED
|
@@ -5,7 +5,6 @@ const assert = require('assert')
|
|
|
5
5
|
const deviceId = 122575
|
|
6
6
|
// eslint-disable-next-line no-undef
|
|
7
7
|
describe('Test_Reports', function () {
|
|
8
|
-
this.timeout(5000000)
|
|
9
8
|
it('Trip by device', async () => {
|
|
10
9
|
console.log('trip by device')
|
|
11
10
|
const report = await getReports()
|
package/src/tests/zones.test.js
CHANGED
|
@@ -2,7 +2,6 @@ const { getReports } = require('./index')
|
|
|
2
2
|
const assert = require('assert')
|
|
3
3
|
// eslint-disable-next-line no-undef
|
|
4
4
|
describe('zones', function () {
|
|
5
|
-
this.timeout(500000)
|
|
6
5
|
// eslint-disable-next-line no-undef
|
|
7
6
|
it('works with ellca', async () => {
|
|
8
7
|
const report = await getReports()
|
package/src/util/parallel.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const { sliceArray } = require('../automaticReports')
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
console.log('cpu count', require('os').cpus())
|
|
2
|
+
const cluster = require('cluster')
|
|
3
|
+
const path = require('path')
|
|
5
4
|
|
|
6
5
|
exports.parallel = (report, method, devices, route, userData) => {
|
|
7
6
|
const numCPUs = require('os').cpus().length
|
|
@@ -9,7 +8,7 @@ exports.parallel = (report, method, devices, route, userData) => {
|
|
|
9
8
|
if (cluster.isPrimary) {
|
|
10
9
|
console.log(`Master ${process.pid} is running`, process.cwd())
|
|
11
10
|
cluster.setupPrimary({
|
|
12
|
-
exec: '
|
|
11
|
+
exec: path.resolve(__dirname, 'worker.js')
|
|
13
12
|
})
|
|
14
13
|
const sliced = sliceArray(devices, numCPUs)
|
|
15
14
|
const _result = []
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
|
|
1
3
|
process.on('message', async (message) => {
|
|
2
4
|
const { report, method, args } = message
|
|
3
|
-
|
|
4
|
-
const _report = require(`./${report}`)
|
|
5
|
+
const _report = require(path.resolve(__dirname, `../${report}`))
|
|
5
6
|
process.send({ result: await _report[method](...args) })
|
|
6
7
|
})
|