From 42ece4f8b85a51f37b6c87f3378a34989e90a328 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 6 May 2024 01:06:46 -0400 Subject: [PATCH] Fix --- commands/util/exec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/util/exec.js b/commands/util/exec.js index 853693cb..fd0b8753 100644 --- a/commands/util/exec.js +++ b/commands/util/exec.js @@ -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 }; } }