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,6 +1,7 @@
|
||||
import { serve } from '@hono/node-server';
|
||||
import { serveStatic } from '@hono/node-server/serve-static';
|
||||
import type { HookManager, HookProcessInfo } from '@snowluma/bridge';
|
||||
import { getRuntimeIntegrity, hasLowProcessIntegrity } from '@snowluma/bridge';
|
||||
import {
|
||||
clearManagedLogs,
|
||||
configureFileTransport,
|
||||
@@ -1384,6 +1385,7 @@ export async function initWebUI(
|
||||
},
|
||||
runtime: {
|
||||
pid: process.pid,
|
||||
lowIntegrity: hasLowProcessIntegrity(getRuntimeIntegrity()),
|
||||
rss: runtimeMemory.rss,
|
||||
heapTotal: runtimeMemory.heapTotal,
|
||||
heapUsed: runtimeMemory.heapUsed,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { isRealUin } from '@snowluma/common/uin';
|
||||
import { isObject } from '@snowluma/common/coerce';
|
||||
import type { Hono } from 'hono';
|
||||
import {
|
||||
StorageAccountOnlineError,
|
||||
@@ -367,7 +368,3 @@ function cleanupFailureItem(failure: StorageCleanupResult['failures'][number]):
|
||||
|
||||
return failure.item;
|
||||
}
|
||||
|
||||
function isObject(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isObject } from '@snowluma/common/coerce';
|
||||
import type { LogStoragePolicy, LogStorageStatus } from '@snowluma/common/log-file-transport';
|
||||
import {
|
||||
DEFAULT_LOG_MAX_TOTAL_MB,
|
||||
@@ -322,7 +323,3 @@ function assertPersistedSettings(runtime: RuntimeConfig, expected: LogStorageSet
|
||||
throw new Error('persisted log storage settings do not match the requested values');
|
||||
}
|
||||
}
|
||||
|
||||
function isObject(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
// nested `webuiTls.enabled`.
|
||||
|
||||
import type { RuntimeConfig } from '@snowluma/common/runtime';
|
||||
import { isObject } from '@snowluma/common/coerce';
|
||||
import { checkListenerExposure } from './listener-exposure';
|
||||
|
||||
export type SettingsPatch = Partial<
|
||||
@@ -12,10 +13,6 @@ export type SettingsPatch = Partial<
|
||||
|
||||
export type CoerceResult = { ok: true; patch: SettingsPatch } | { ok: false; error: string };
|
||||
|
||||
function isObject(v: unknown): v is Record<string, unknown> {
|
||||
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
||||
}
|
||||
|
||||
export function coerceSettingsPatch(body: unknown): CoerceResult {
|
||||
if (!isObject(body)) {
|
||||
return { ok: false, error: 'body must be an object' };
|
||||
|
||||
Reference in new issue
Block a user