Fix call order when closing sqlite in renderer

This commit is contained in:
Fedor Indutny 2021-09-07 14:21:55 -07:00 committed by GitHub
parent a3eed6191e
commit 1a3f87f7f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -307,10 +307,13 @@ async function goBackToMainProcess(): Promise<void> {
window.log.info('data.goBackToMainProcess: switching to main process');
// Close the database in the renderer process.
await close();
const closePromise = close();
// It should be the last query we run in renderer process
shouldUseRendererProcess = false;
await closePromise;
// Print query statistics for whole startup
const entries = Array.from(startupQueries.entries());
startupQueries.clear();