feat: migrate frontend to Astro + expand AI moderation + backend admin/runtime config
Frontend: - migrate from Vite to Astro (astro.config.mjs, pages/, layouts/) - add admin panel, settings page, command palette, error boundary - refactor App.tsx, MascotChatbot, Sidebar, Header, DashboardLayout - update API client, WebSocket, auth, dashboard features Backend: - add admin module and config routes - refactor middlewares, Redis connection, WebSocket server/bridge - add runtime config loader Discord Gateway: - refactor AI moderation: circuit breaker, concurrency limiter, fallback processor - add media analysis client, Seaxng search, user profile learner - add new drizzle migration Shared: - extend database schema, add new config fields
This commit is contained in:
@@ -36,6 +36,10 @@ export const workerPool = new Piscina({
|
||||
filename: fileURLToPath(getAnalysisWorkerUrl()),
|
||||
execArgv: process.execArgv,
|
||||
maxThreads: config.PISCINA_MAX_THREADS ?? availableParallelism(),
|
||||
// Each worker processes at most 1 task at a time so the pool itself
|
||||
// acts as the concurrency governor. Combined with per-worker p-limit
|
||||
// inside concurrencyLimiter.ts, this prevents LLM API overload.
|
||||
concurrentTasksPerWorker: 1,
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -228,7 +232,7 @@ export function scheduleAutoDelete(row: MessageRecord): void {
|
||||
};
|
||||
|
||||
if (config.AUTO_DELETE_FLAGGED_DELAY_MS > 0) {
|
||||
setTimeout(run, config.AUTO_DELETE_FLAGGED_DELAY_MS);
|
||||
setTimeout(run, config.AUTO_DELETE_FLAGGED_DELAY_MS).unref();
|
||||
return;
|
||||
}
|
||||
setImmediate(run);
|
||||
|
||||
Reference in New Issue
Block a user