mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
refactor(server): preserve cache-failure stack trace and reuse hasSearch
This commit is contained in:
@@ -29,9 +29,8 @@ export class BaseQueryRouter {
|
||||
const hasSearch = !!args.search;
|
||||
if (!hasFilter && !hasSorts && !hasSearch) return 'postgres';
|
||||
|
||||
// v1: any search stays on Postgres. Trgm search also stays on Postgres
|
||||
// until the loader populates `search_text`; re-evaluate after that lands.
|
||||
if (args.search) return 'postgres';
|
||||
// v1: any search stays on Postgres — loader doesn't populate search_text yet.
|
||||
if (hasSearch) return 'postgres';
|
||||
|
||||
const count = await this.baseRowRepo.countActiveRows(args.baseId, {
|
||||
workspaceId: args.workspaceId,
|
||||
|
||||
@@ -227,10 +227,11 @@ export class BaseRowService {
|
||||
pagination,
|
||||
});
|
||||
} catch (err) {
|
||||
const error = err as Error;
|
||||
this.logger.warn(
|
||||
`Cache list failed for base ${dto.baseId}, falling back to Postgres`,
|
||||
err as Error,
|
||||
`Cache list failed for base ${dto.baseId}, falling back to Postgres: ${error.message}`,
|
||||
);
|
||||
if (error.stack) this.logger.warn(error.stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user