feat: implement function management with FunctionEntity, FunctionService, and FunctionController; enhance QueryExecuterService to utilize functions; refactor CommandController and QueryController to extend BaseQueryController; update Vm class to handle functions; remove obsolete log entities
This commit is contained in:
@ -9,6 +9,7 @@ export class Vm {
|
||||
private context: any;
|
||||
private jail: any;
|
||||
private plugins: Plugin[];
|
||||
private functions: string[];
|
||||
private isolate: ivm.Isolate;
|
||||
private timeLimit?: bigint;
|
||||
private cpuTimeLimit?: bigint;
|
||||
@ -19,12 +20,14 @@ export class Vm {
|
||||
cpuTimeLimit?: bigint;
|
||||
modules: VModule[];
|
||||
plugins: Plugin[];
|
||||
functions: string[];
|
||||
}) {
|
||||
this.memoryLimit = configs.memoryLimit;
|
||||
this.modules = configs.modules;
|
||||
this.plugins = configs.plugins;
|
||||
this.timeLimit = configs.timeLimit;
|
||||
this.cpuTimeLimit = configs.cpuTimeLimit;
|
||||
this.functions = configs.functions;
|
||||
}
|
||||
|
||||
async init(): Promise<Vm> {
|
||||
@ -38,6 +41,10 @@ export class Vm {
|
||||
await this.context.eval(mod.getSource());
|
||||
}
|
||||
|
||||
for (const fn of this.functions) {
|
||||
await this.context.eval(fn);
|
||||
}
|
||||
|
||||
for (const plugin of this.plugins) {
|
||||
const pluginName = plugin.getName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user