convert more execSync to async

This commit is contained in:
Girish Ramakrishnan
2024-02-20 23:09:49 +01:00
parent b51071155a
commit 9b94cf18d0
15 changed files with 71 additions and 72 deletions
+3 -2
View File
@@ -47,6 +47,7 @@ const apps = require('./apps.js'),
safe = require('safetydance'),
semver = require('semver'),
settings = require('./settings.js'),
shell = require('./shell.js'),
superagent = require('superagent'),
support = require('./support.js');
@@ -395,8 +396,8 @@ async function createTicket(info, auditSource) {
const logPaths = await apps.getLogPaths(info.app);
for (const logPath of logPaths) {
const logs = safe.child_process.execSync(`tail --lines=1000 ${logPath}`);
if (logs) request.attach(path.basename(logPath), logs, path.basename(logPath));
const [error, logs] = await safe(shell.promises.exec('createTicket', `tail --lines=1000 ${logPath}`, {}));
if (!error && logs) request.attach(path.basename(logPath), logs, path.basename(logPath));
}
} else {
request.send(info);