Skip to content

Commit

Permalink
fix: VVPPデフォルトエンジンダウンロード後、確実にファイルが閉じられるまで待つ (#2466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba authored Jan 3, 2025
1 parent b80b70e commit 4954e9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backend/electron/engineAndVvppController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ export class EngineAndVvppController {
progress: (downloadedBytes / totalBytes) * 100,
});
}

// ファイルを確実に閉じる
const { promise, resolve, reject } = Promise.withResolvers();
fileStream.on("close", resolve);
fileStream.on("error", reject);
fileStream.close();
await promise;

downloadedPaths.push(downloadPath);
log.info(`Downloaded ${name} to ${downloadPath}`);
Expand Down

0 comments on commit 4954e9a

Please sign in to comment.