Fix call order when closing sqlite in renderer
This commit is contained in:
@@ -307,10 +307,13 @@ async function goBackToMainProcess(): Promise<void> {
|
|||||||
window.log.info('data.goBackToMainProcess: switching to main process');
|
window.log.info('data.goBackToMainProcess: switching to main process');
|
||||||
|
|
||||||
// Close the database in the renderer 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;
|
shouldUseRendererProcess = false;
|
||||||
|
|
||||||
|
await closePromise;
|
||||||
|
|
||||||
// Print query statistics for whole startup
|
// Print query statistics for whole startup
|
||||||
const entries = Array.from(startupQueries.entries());
|
const entries = Array.from(startupQueries.entries());
|
||||||
startupQueries.clear();
|
startupQueries.clear();
|
||||||
|
Reference in New Issue
Block a user