mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-15 12:55:59 +00:00
fix auth error in transactor rcp (#7661)
Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>
This commit is contained in:
parent
6711ceb877
commit
e81100cbaf
@ -2,11 +2,8 @@
|
|||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
indent_style = tab
|
indent_style = space
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.yml]
|
|
||||||
indent_style = space
|
|
||||||
|
@ -68,7 +68,7 @@ class TransactorRpcTarget extends RpcTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getModel (): Promise<any> {
|
async getModel (): Promise<any> {
|
||||||
return (this.transactor as any).getModel()
|
return (this.transactor as any).getModel(this.token)
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAccount (): Promise<any> {
|
async getAccount (): Promise<any> {
|
||||||
|
@ -387,6 +387,7 @@ export class Transactor extends DurableObject<Env> {
|
|||||||
const session = await this.makeRpcSession(rawToken, cs)
|
const session = await this.makeRpcSession(rawToken, cs)
|
||||||
const pipeline =
|
const pipeline =
|
||||||
session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline
|
session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline
|
||||||
|
;(session as any).includeSessionContext(this.measureCtx, pipeline)
|
||||||
result = await pipeline.findAll(this.measureCtx, _class, query ?? {}, options ?? {})
|
result = await pipeline.findAll(this.measureCtx, _class, query ?? {}, options ?? {})
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
result = { error: `${error}` }
|
result = { error: `${error}` }
|
||||||
@ -403,7 +404,8 @@ export class Transactor extends DurableObject<Env> {
|
|||||||
const session = await this.makeRpcSession(rawToken, cs)
|
const session = await this.makeRpcSession(rawToken, cs)
|
||||||
const pipeline =
|
const pipeline =
|
||||||
session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline
|
session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline
|
||||||
await pipeline.tx(this.measureCtx, [tx])
|
;(session as any).includeSessionContext(this.measureCtx, pipeline)
|
||||||
|
result = await pipeline.tx(this.measureCtx, [tx])
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
result = { error: `${error}` }
|
result = { error: `${error}` }
|
||||||
} finally {
|
} finally {
|
||||||
@ -419,6 +421,7 @@ export class Transactor extends DurableObject<Env> {
|
|||||||
const session = await this.makeRpcSession(rawToken, cs)
|
const session = await this.makeRpcSession(rawToken, cs)
|
||||||
const pipeline =
|
const pipeline =
|
||||||
session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline
|
session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline
|
||||||
|
;(session as any).includeSessionContext(this.measureCtx, pipeline)
|
||||||
const ret = await pipeline.loadModel(this.measureCtx, 0)
|
const ret = await pipeline.loadModel(this.measureCtx, 0)
|
||||||
if (Array.isArray(ret)) {
|
if (Array.isArray(ret)) {
|
||||||
result = ret
|
result = ret
|
||||||
@ -426,7 +429,7 @@ export class Transactor extends DurableObject<Env> {
|
|||||||
result = ret.transactions
|
result = ret.transactions
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
result = []
|
return { error: `${error}` }
|
||||||
} finally {
|
} finally {
|
||||||
await this.sessionManager.close(this.measureCtx, cs, this.workspace)
|
await this.sessionManager.close(this.measureCtx, cs, this.workspace)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user