SilverBullet pivot to become an offline-first PWA (#403)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { Hook, Manifest } from "../types.ts";
|
||||
import { Cron } from "https://cdn.jsdelivr.net/gh/hexagon/croner@4/src/croner.js";
|
||||
import { safeRun } from "../util.ts";
|
||||
import { System } from "../system.ts";
|
||||
export type CronHookT = {
|
||||
cron?: string | string[];
|
||||
@@ -51,13 +50,13 @@ export class CronHook implements Hook<CronHookT> {
|
||||
this.tasks.push(
|
||||
new Cron(cronDef, () => {
|
||||
// console.log("Now acting on cron", cronDef);
|
||||
safeRun(async () => {
|
||||
(async () => {
|
||||
try {
|
||||
await plug.invoke(name, [cronDef]);
|
||||
} catch (e: any) {
|
||||
console.error("Execution of cron function failed", e);
|
||||
}
|
||||
});
|
||||
})().catch(console.error);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user