Fix scheduling of paging queries

This commit is contained in:
Fedor Indutny
2025-03-26 12:43:29 -07:00
committed by GitHub
parent b0653d06fe
commit 87236c940f

View File

@@ -254,10 +254,11 @@ export class MainSQL {
}>;
// pageMessages runs over several queries and needs to have access to
// the same temporary table.
// the same temporary table, it also creates temporary insert/update
// triggers so it has to run on the same connection that updates the tables
const isPaging = PAGING_QUERIES.has(method);
const entry = isPaging ? this.#pool.at(-1) : this.#getWorker();
const entry = isPaging ? this.#pool[0] : this.#getWorker();
strictAssert(entry != null, 'Must have a pool entry');
const { result, duration } = await this.#send<SqlCallResult>(entry, {