Separate calls in sql channel

This commit is contained in:
Fedor Indutny
2024-08-12 12:54:24 -07:00
committed by GitHub
parent 85b130a12d
commit 9a98ae0a4e
7 changed files with 90 additions and 45 deletions

View File

@@ -9,6 +9,7 @@ import { missingCaseError } from '../util/missingCaseError';
const SQL_READ_KEY = 'sql-channel:read';
const SQL_WRITE_KEY = 'sql-channel:write';
const SQL_REMOVE_DB_KEY = 'sql-channel:remove-db';
let activeJobCount = 0;
let resolveShutdown: (() => void) | undefined;
let shutdownPromise: Promise<void> | null = null;
@@ -77,3 +78,7 @@ export async function doShutdown(): Promise<void> {
log.info('data.shutdown: process complete');
}
}
export async function removeDB(): Promise<void> {
return ipcRenderer.invoke(SQL_REMOVE_DB_KEY);
}