mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-27 22:15:33 +00:00
fix(minions): default timeout for contextual reindex (#2611)
This commit is contained in:
committed by
Garry Tan
parent
ca47c054b8
commit
3d8a9e81d0
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
const THIRTY_MIN_MS = 30 * 60 * 1000;
|
||||
const SIXTY_MIN_MS = 60 * 60 * 1000;
|
||||
const TEN_MIN_MS = 10 * 60 * 1000;
|
||||
|
||||
/**
|
||||
@@ -42,6 +43,10 @@ export const HANDLER_DEFAULT_TIMEOUT_MS: Readonly<Record<string, number>> = {
|
||||
// few writes. Generous 10-min budget (vs the tight null-default) covers a
|
||||
// slow gateway without the 30-min loop budget.
|
||||
chronicle_extract: TEN_MIN_MS,
|
||||
// Per-page contextual reindex jobs process chunks sequentially with one
|
||||
// rate-leased LLM synopsis call per chunk; large transcript pages need more
|
||||
// than the standard 30-min long-job budget.
|
||||
contextual_reindex_per_chunk: SIXTY_MIN_MS,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -354,6 +354,13 @@ describe('MinionQueue: #1737 per-handler default timeout', () => {
|
||||
expect(sub.timeout_ms).toBe(30 * 60 * 1000);
|
||||
});
|
||||
|
||||
test('contextual per-chunk reindex gets the 60-min default', async () => {
|
||||
const job = await queue.add('contextual_reindex_per_chunk', { page_slug: 'large-transcript' }, undefined, {
|
||||
allowProtectedSubmit: true,
|
||||
});
|
||||
expect(job.timeout_ms).toBe(60 * 60 * 1000);
|
||||
});
|
||||
|
||||
test('explicit timeout_ms always wins over the default', async () => {
|
||||
const job = await queue.add('embed-backfill', { sourceId: 'x' }, { timeout_ms: 5000 });
|
||||
expect(job.timeout_ms).toBe(5000);
|
||||
|
||||
Reference in New Issue
Block a user