mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 21:35:10 +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,
|
WithTx,
|
||||||
WorkspaceEvent,
|
WorkspaceEvent,
|
||||||
checkMixinKey,
|
checkMixinKey,
|
||||||
|
clone,
|
||||||
findProperty,
|
findProperty,
|
||||||
generateId,
|
generateId,
|
||||||
getObjectValue,
|
getObjectValue,
|
||||||
@ -352,12 +353,13 @@ export class LiveQuery implements WithTx, Client {
|
|||||||
callback: { callback: (result: FindResult<T>) => void, callbackId: string } | undefined,
|
callback: { callback: (result: FindResult<T>) => void, callbackId: string } | undefined,
|
||||||
options?: FindOptions<T>
|
options?: FindOptions<T>
|
||||||
): Query {
|
): Query {
|
||||||
|
const _query: DocumentQuery<T> = clone(query)
|
||||||
const localResult = this.refs.findFromDocs(_class, query, options)
|
const localResult = this.refs.findFromDocs(_class, query, options)
|
||||||
const result = localResult != null ? Promise.resolve(localResult) : this.client.findAll(_class, query, options)
|
const result = localResult != null ? Promise.resolve(localResult) : this.client.findAll(_class, query, options)
|
||||||
const q: Query = {
|
const q: Query = {
|
||||||
id: ++this.queryCounter,
|
id: ++this.queryCounter,
|
||||||
_class,
|
_class,
|
||||||
query,
|
query: _query,
|
||||||
result: result.then((docs) => new ResultArray(docs, this.getHierarchy())),
|
result: result.then((docs) => new ResultArray(docs, this.getHierarchy())),
|
||||||
total: 0,
|
total: 0,
|
||||||
options: options as FindOptions<Doc>,
|
options: options as FindOptions<Doc>,
|
||||||
|
@ -803,11 +803,12 @@ abstract class PostgresAdapterBase implements DbAdapter {
|
|||||||
private buildQuery<T extends Doc>(
|
private buildQuery<T extends Doc>(
|
||||||
_class: Ref<Class<T>>,
|
_class: Ref<Class<T>>,
|
||||||
baseDomain: string,
|
baseDomain: string,
|
||||||
query: DocumentQuery<T>,
|
_query: DocumentQuery<T>,
|
||||||
joins: JoinProps[],
|
joins: JoinProps[],
|
||||||
options?: ServerFindOptions<T>
|
options?: ServerFindOptions<T>
|
||||||
): string {
|
): string {
|
||||||
const res: string[] = []
|
const res: string[] = []
|
||||||
|
const query = { ..._query }
|
||||||
res.push(`${baseDomain}."workspaceId" = '${this.workspaceId.name}'`)
|
res.push(`${baseDomain}."workspaceId" = '${this.workspaceId.name}'`)
|
||||||
if (options?.skipClass !== true) {
|
if (options?.skipClass !== true) {
|
||||||
query._class = this.fillClass(_class, query) as any
|
query._class = this.fillClass(_class, query) as any
|
||||||
|
Loading…
Reference in New Issue
Block a user