Remove unnecessary async on handling journald stderr entries

Change-type: patch
This commit is contained in:
Pagan Gazzard 2023-10-11 14:11:06 +01:00 committed by Felipe Lalanne
parent e3806ec018
commit 74d374b5ad

View File

@ -70,13 +70,13 @@ class LogMonitor {
format: 'json', format: 'json',
filterString: '_SYSTEMD_UNIT=balena.service', filterString: '_SYSTEMD_UNIT=balena.service',
}, },
(row: JournalRow) => { (row) => {
if (row.CONTAINER_ID_FULL && this.containers[row.CONTAINER_ID_FULL]) { if (row.CONTAINER_ID_FULL && this.containers[row.CONTAINER_ID_FULL]) {
this.setupAttempts = 0; this.setupAttempts = 0;
this.handleRow(row); this.handleRow(row);
} }
}, },
(data: Buffer) => { (data) => {
log.error('journalctl - balena.service stderr: ', data.toString()); log.error('journalctl - balena.service stderr: ', data.toString());
}, },
() => { () => {
@ -154,8 +154,8 @@ class LogMonitor {
filterString: `CONTAINER_ID_FULL=${containerId}`, filterString: `CONTAINER_ID_FULL=${containerId}`,
since: toJournalDate(lastSentTimestamp + 1), // increment to exclude last sent log since: toJournalDate(lastSentTimestamp + 1), // increment to exclude last sent log
}, },
(row: JournalRow) => this.handleRow(row), (row) => this.handleRow(row),
async (data: Buffer) => { (data) => {
log.error( log.error(
`journalctl - container ${containerId} stderr: `, `journalctl - container ${containerId} stderr: `,
data.toString(), data.toString(),