Improved and re-enabled why-is-node-running logger.

This commit is contained in:
DebaucheryLibrarian 2021-12-18 23:44:51 +01:00
parent cdb7dcd6e9
commit 1c0c30be11
1 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
'use strict';
const util = require('util');
// const log = require('why-is-node-running');
const log = require('why-is-node-running');
const Inspector = require('inspector-api');
const fs = require('fs').promises;
const dayjs = require('dayjs');
@ -25,11 +25,12 @@ const inspector = new Inspector();
let done = false;
function logActive() {
console.log('log active!');
setTimeout(() => {
// log();
log();
if (!done) {
logActive();
}
}, typeof argv.logActive === 'number' ? argv.logActive : 60000);
}