fix(db,frontend): reserve DB connections for API and reduce frontend polling
Background tasks (ingestion, PDF resolution, scheduler) now acquire an asyncio.Semaphore before checking out a DB connection, guaranteeing at least N connections remain available for API request handlers. Removes duplicate polling loop from PublicationsPage, debounces publication reload on run-status changes, and increases poll interval from 5s to 15s since SSE handles live discovery. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a490e14126
commit
f50b609a36
11 changed files with 97 additions and 69 deletions
|
|
@ -277,12 +277,16 @@ export function usePublicationData() {
|
|||
|
||||
// --- Run-triggered refresh watcher ---
|
||||
|
||||
let previousRunStatusKey: string | null = null;
|
||||
|
||||
watch(
|
||||
() => runStatus.latestRun,
|
||||
async (nextRun, previousRun) => {
|
||||
const nextRunId = nextRun && (nextRun.status === "running" || nextRun.status === "resolving") ? nextRun.id : null;
|
||||
const previousRunId = previousRun && (previousRun.status === "running" || previousRun.status === "resolving") ? previousRun.id : null;
|
||||
if (nextRunId === null || nextRunId === previousRunId) return;
|
||||
async (nextRun) => {
|
||||
const nextStatus = nextRun ? `${nextRun.id}:${nextRun.status}` : null;
|
||||
if (nextStatus === previousRunStatusKey) return;
|
||||
previousRunStatusKey = nextStatus;
|
||||
const isActive = nextRun && (nextRun.status === "running" || nextRun.status === "resolving");
|
||||
if (!isActive) return;
|
||||
resetPageAndSnapshot();
|
||||
await loadPublications();
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue