This commit is contained in:
Dragon Fire
2024-05-06 01:06:46 -04:00
parent 80e706cc81
commit 42ece4f8b8
+3 -2
View File
@@ -36,13 +36,14 @@ module.exports = class ExecCommand extends Command {
async exec(command) {
let hrDiff;
const hrStart = process.hrtime();
try {
const hrStart = process.hrtime();
const { stdout } = await execAsync(command, { timeout: 30000, encoding: 'utf8' });
hrDiff = process.hrtime(hrStart);
return { err: false, std: stdout.trim(), hrDiff };
} catch (err) {
return { err: true, std: err.stderr.trim(), hrDiff: null };
hrDiff = process.hrtime(hrStart);
return { err: true, std: err.stderr.trim(), hrDiff };
}
}