1
0
This commit is contained in:
Zef Hemel 2023-12-17 15:10:00 +01:00
parent fc115e5a74
commit 0964775517
2 changed files with 6 additions and 2 deletions

View File

@ -52,7 +52,9 @@ export class CronHook implements Hook<CronHookT> {
// console.log("Now acting on cron", cronDef);
(async () => {
try {
if (await plug.canInvoke(name)) {
await plug.invoke(name, [cronDef]);
}
} catch (e: any) {
console.error("Execution of cron function failed", e);
}

View File

@ -47,7 +47,9 @@ export class Plug<HookT> {
return this.system.syscallWithContext({ plug: this }, name, args);
}
// Checks if a function can be invoked (it may be restricted on its execution environment)
/**
* Checks if a function can be invoked (it may be restricted on its execution environment)
*/
async canInvoke(name: string) {
await this.ready;
const funDef = this.manifest!.functions[name];