apploader增加了execRoutine方法
This commit is contained in:
parent
fc0a391638
commit
a834e22c9a
|
|
@ -21,4 +21,5 @@ export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt exten
|
|||
getEndpoints(): Record<string, Endpoint<ED, Cxt>>;
|
||||
startTimers(): void;
|
||||
execStartRoutines(): Promise<void>;
|
||||
execRoutine(routine: (context: Cxt) => Promise<void>): Promise<void>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,5 +217,9 @@ class AppLoader extends types_1.AppLoader {
|
|||
}
|
||||
}
|
||||
}
|
||||
async execRoutine(routine) {
|
||||
const context = await this.contextBuilder()(this.dbStore);
|
||||
await routine(context);
|
||||
}
|
||||
}
|
||||
exports.AppLoader = AppLoader;
|
||||
|
|
|
|||
|
|
@ -261,4 +261,9 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Async
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
async execRoutine(routine: (context: Cxt) => Promise<void>) {
|
||||
const context = await this.contextBuilder()(this.dbStore);
|
||||
await routine(context);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue