This commit is contained in:
seb
2026-10-29 03:39:12 +01:00
parent 72e6e79d20
commit 005b48ff66
2 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import { clearCachedCompanyUsers, clearCachedUser } from '../api/middleware/auth
import { clearDeletedCompany, setUserCompany } from '../api/sse.js';
const storeLog = createLogger('libstore');
const schemaLog = createLogger('schema');
let provider;
let store;
@@ -146,7 +147,12 @@ export async function getStore() {
if (!connecting) {
connecting = (async () => {
provider = createProvider();
await provider.initialize();
try {
await provider.initialize((msg) => schemaLog.info(msg));
} catch (err) {
schemaLog.error('Database schema initialization failed:', err);
throw err;
}
store = wrapStoreWithTiming(await new LibDashStore(provider));
return store;
})().finally(() => {