feat(tests): new scanner test
This commit is contained in:
@ -5,7 +5,7 @@ let keepTime = process.hrtime()
|
||||
let keepUsage = process.cpuUsage()
|
||||
let sw = false
|
||||
|
||||
setInterval(() => {
|
||||
const cpuTimer = setInterval(() => {
|
||||
if(!sw) {
|
||||
keepTime = process.hrtime();
|
||||
keepUsage = process.cpuUsage();
|
||||
@ -14,9 +14,11 @@ setInterval(() => {
|
||||
startTime = keepTime;
|
||||
startUsage = keepUsage;
|
||||
sw = false;
|
||||
}
|
||||
}
|
||||
}, 500)
|
||||
|
||||
cpuTimer.unref()
|
||||
|
||||
module.exports = () => {
|
||||
function secNSec2ms (secNSec) {
|
||||
return secNSec[0] * 1000 + secNSec[1] / 1000000
|
||||
|
@ -3,7 +3,8 @@
|
||||
module.exports = class {
|
||||
constructor() {
|
||||
this.generate()
|
||||
setInterval(()=> this.generate(), 60000*15)
|
||||
const it = setInterval(() => this.generate(), 60000*15)
|
||||
it.unref()
|
||||
}
|
||||
|
||||
isValid(t) {
|
||||
|
@ -43,7 +43,7 @@ const fs = require('fs');
|
||||
const debug = require('debug')('config')
|
||||
|
||||
let configPath = 'config.json'
|
||||
if(app.getPath("userData") && app.getPath("userData").length > 0)
|
||||
if(app && app.getPath("userData") && app.getPath("userData").length > 0)
|
||||
{
|
||||
configPath = app.getPath("userData") + '/config.json'
|
||||
}
|
||||
|
Reference in New Issue
Block a user