feat: add async SQLite on Node 24 and improve messaging diagnostics (#520)
Move database work off the main thread on Node.js 24 and improve message handling and runtime diagnostics. Preserve migration, restart, and concurrency coverage with the async SQLite driver.
This commit is contained in:
1 parent
20f48d11ec
commit
c7428363cb
170 files changed
+7748
-3913
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { HookManager } from '@snowluma/bridge';
|
||||
import { getRuntimeIntegrity, HookManager } from '@snowluma/bridge';
|
||||
import { configureFileTransport } from '@snowluma/common/log-file-transport';
|
||||
import { closeLogger, createLogger } from '@snowluma/common/logger';
|
||||
import {
|
||||
@@ -20,6 +20,7 @@ import { createNotificationManager } from './notifications/manager';
|
||||
import { createStateWiring } from './webui/state-wiring';
|
||||
import { bindSystemFaceCatalog } from './sys-face-catalog';
|
||||
import { readAppVersion, startNativeStageSync, tempStagePath } from './native-stage-sync';
|
||||
import { logRuntimeIntegrity } from './runtime-integrity-log';
|
||||
|
||||
const log = createLogger('App');
|
||||
|
||||
@@ -51,6 +52,7 @@ async function main() {
|
||||
perUinEnabled: runtimeConfig.logPerUin ?? DEFAULT_LOG_PER_UIN,
|
||||
});
|
||||
log.info('SnowLuma starting');
|
||||
logRuntimeIntegrity(getRuntimeIntegrity());
|
||||
const stopNativeStageSync = startNativeStageSync({
|
||||
version: readAppVersion(import.meta.url),
|
||||
dataDir: 'data',
|
||||
@@ -196,6 +198,16 @@ async function main() {
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
await bridgeManager.dispose();
|
||||
} catch (error) {
|
||||
exitCode = 1;
|
||||
log.error(
|
||||
'bridge shutdown failed: %s',
|
||||
error instanceof Error ? (error.stack ?? error.message) : String(error),
|
||||
);
|
||||
}
|
||||
|
||||
await closeLogger();
|
||||
process.exit(exitCode);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user