fix: logging

This commit is contained in:
Andras Bacsai
2022-09-15 14:27:55 +02:00
parent e9e6449edf
commit f75af035bb
7 changed files with 47 additions and 9 deletions

View File

@@ -472,17 +472,20 @@ export const saveBuildLog = async ({
if (isDev) {
console.debug(`[${applicationId}] ${addTimestamp}`);
}
try {
return await got.post(`${fluentBitUrl}/${applicationId}_buildlog_${buildId}.csv`, {
json: {
line: encrypt(line)
}
})
} catch(error) {
return await prisma.buildLog.create({
data: {
line: addTimestamp, buildId, time: Number(day().valueOf()), applicationId
}
});
}
return await got.post(`${fluentBitUrl}/${applicationId}_buildlog_${buildId}.csv`, {
json: {
line: encrypt(line)
}
})
};