backendRuntimeContext增加了clearSubscriber方法

This commit is contained in:
Xu Chang 2024-04-24 18:31:20 +08:00
parent b5d7e00828
commit 9e6d15b49a
7 changed files with 33 additions and 0 deletions

View File

@ -24,4 +24,8 @@ export declare abstract class BackendRuntimeContext<ED extends EntityDict & Base
saveOperationToEvent(operationId: string, event: string): void;
commit(): Promise<void>;
rollback(): Promise<void>;
/**
* subscriberIdtaicang)
*/
clearSubscriber(): void;
}

View File

@ -55,4 +55,10 @@ export class BackendRuntimeContext extends AsyncContext {
this.eventOperationMap = {};
return super.rollback();
}
/**
* 某些特殊应用可能要手动清除subscriberIdtaicang)
*/
clearSubscriber() {
this.subscriberId = undefined;
}
}

View File

@ -806,6 +806,9 @@ export function createComponent(option, features) {
ready() {
// 等oakFullpath构建完成后再ready
if (this.state.oakFullpath) {
if (this.props.oakId) {
this.features.runningTree.setId(this.state.oakFullpath, this.props.oakId);
}
ready && ready.call(this);
}
else if (!this.oakOption.entity) {

View File

@ -24,4 +24,8 @@ export declare abstract class BackendRuntimeContext<ED extends EntityDict & Base
saveOperationToEvent(operationId: string, event: string): void;
commit(): Promise<void>;
rollback(): Promise<void>;
/**
* subscriberIdtaicang)
*/
clearSubscriber(): void;
}

View File

@ -59,5 +59,11 @@ class BackendRuntimeContext extends AsyncRowStore_1.AsyncContext {
this.eventOperationMap = {};
return super.rollback();
}
/**
* 某些特殊应用可能要手动清除subscriberIdtaicang)
*/
clearSubscriber() {
this.subscriberId = undefined;
}
}
exports.BackendRuntimeContext = BackendRuntimeContext;

View File

@ -809,6 +809,9 @@ function createComponent(option, features) {
ready() {
// 等oakFullpath构建完成后再ready
if (this.state.oakFullpath) {
if (this.props.oakId) {
this.features.runningTree.setId(this.state.oakFullpath, this.props.oakId);
}
ready && ready.call(this);
}
else if (!this.oakOption.entity) {

View File

@ -71,4 +71,11 @@ export abstract class BackendRuntimeContext<ED extends EntityDict & BaseEntityDi
this.eventOperationMap = {};
return super.rollback();
}
/**
* subscriberIdtaicang)
*/
clearSubscriber() {
this.subscriberId = undefined;
}
}