mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
UBERF-8603: Fix memory leak (#7229)
Some checks failed
CI / build (push) Has been cancelled
CI / uitest (push) Has been cancelled
CI / uitest-pg (push) Has been cancelled
CI / uitest-qms (push) Has been cancelled
CI / svelte-check (push) Has been cancelled
CI / formatting (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker-build (push) Has been cancelled
CI / dist-build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
CI / uitest (push) Has been cancelled
CI / uitest-pg (push) Has been cancelled
CI / uitest-qms (push) Has been cancelled
CI / svelte-check (push) Has been cancelled
CI / formatting (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker-build (push) Has been cancelled
CI / dist-build (push) Has been cancelled
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
ea7d82da3b
commit
aea704fd0f
@ -47,6 +47,7 @@ import core, {
|
||||
WithTx,
|
||||
WorkspaceEvent,
|
||||
checkMixinKey,
|
||||
clone,
|
||||
findProperty,
|
||||
generateId,
|
||||
getObjectValue,
|
||||
@ -352,12 +353,13 @@ export class LiveQuery implements WithTx, Client {
|
||||
callback: { callback: (result: FindResult<T>) => void, callbackId: string } | undefined,
|
||||
options?: FindOptions<T>
|
||||
): Query {
|
||||
const _query: DocumentQuery<T> = clone(query)
|
||||
const localResult = this.refs.findFromDocs(_class, query, options)
|
||||
const result = localResult != null ? Promise.resolve(localResult) : this.client.findAll(_class, query, options)
|
||||
const q: Query = {
|
||||
id: ++this.queryCounter,
|
||||
_class,
|
||||
query,
|
||||
query: _query,
|
||||
result: result.then((docs) => new ResultArray(docs, this.getHierarchy())),
|
||||
total: 0,
|
||||
options: options as FindOptions<Doc>,
|
||||
|
@ -803,11 +803,12 @@ abstract class PostgresAdapterBase implements DbAdapter {
|
||||
private buildQuery<T extends Doc>(
|
||||
_class: Ref<Class<T>>,
|
||||
baseDomain: string,
|
||||
query: DocumentQuery<T>,
|
||||
_query: DocumentQuery<T>,
|
||||
joins: JoinProps[],
|
||||
options?: ServerFindOptions<T>
|
||||
): string {
|
||||
const res: string[] = []
|
||||
const query = { ..._query }
|
||||
res.push(`${baseDomain}."workspaceId" = '${this.workspaceId.name}'`)
|
||||
if (options?.skipClass !== true) {
|
||||
query._class = this.fillClass(_class, query) as any
|
||||
|
Loading…
Reference in New Issue
Block a user