Skip to content

Commit

Permalink
chore: switch to fs.promises and add console.debug
Browse files Browse the repository at this point in the history
Signed-off-by: Tim deBoer <[email protected]>
  • Loading branch information
deboer-tim committed Mar 20, 2024
1 parent 7f64517 commit 40609d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/backend/src/build-disk-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export async function buildDiskImage(build: BootcBuildInfo, history: History): P
logData += JSON.stringify(buildImageContainer, undefined, 2);
logData += '\n----------\n';
try {
fs.writeFileSync(logPath, logData);
await fs.promises.writeFile(logPath, logData);
} catch (e) {
// ignore
console.debug('Could not write bootc build log: ', e);
}

if (!buildImageContainer) {
Expand Down Expand Up @@ -172,11 +172,11 @@ export async function buildDiskImage(build: BootcBuildInfo, history: History): P
await history.addOrUpdateBuildInfo(build);

// Step 3.1 Since we have started the container, we can now go get the logs
await logContainer(build.engineId, containerId, progress, data => {
await logContainer(build.engineId, containerId, progress, data => async () => {
try {
fs.appendFileSync(logPath, data);
await fs.promises.appendFile(logPath, data);
} catch (e) {
// ignore
console.debug('Could not write bootc build log: ', e);
}
});

Expand Down

0 comments on commit 40609d2

Please sign in to comment.