Fix paging queries in the worker system
This commit is contained in:
parent
16864e381a
commit
c619a7b6fd
1 changed files with 8 additions and 1 deletions
|
@ -19,6 +19,13 @@ const MIN_TRACE_DURATION = 40;
|
|||
|
||||
const WORKER_COUNT = 4;
|
||||
|
||||
const PAGING_QUERIES = new Set<keyof ServerReadableDirectInterface>([
|
||||
'pageMessages',
|
||||
'finishPageMessages',
|
||||
'getKnownMessageAttachments',
|
||||
'finishGetKnownMessageAttachments',
|
||||
]);
|
||||
|
||||
export type InitializeOptions = Readonly<{
|
||||
appVersion: string;
|
||||
configDir: string;
|
||||
|
@ -216,7 +223,7 @@ export class MainSQL {
|
|||
|
||||
// pageMessages runs over several queries and needs to have access to
|
||||
// the same temporary table.
|
||||
const isPaging = method === 'pageMessages';
|
||||
const isPaging = PAGING_QUERIES.has(method);
|
||||
|
||||
const entry = isPaging ? this.pool.at(-1) : this.getWorker();
|
||||
strictAssert(entry != null, 'Must have a pool entry');
|
||||
|
|
Loading…
Add table
Reference in a new issue