Files
bknd/app/src/flows/tasks/presets/LogTask.ts
T
2025-04-10 10:40:12 +02:00

18 lines
447 B
TypeScript

import { Task } from "../Task";
import * as tbbox from "@sinclair/typebox";
const { Type } = tbbox;
export class LogTask extends Task<typeof LogTask.schema> {
type = "log";
static override schema = Type.Object({
delay: Type.Number({ default: 10 }),
});
async execute() {
await new Promise((resolve) => setTimeout(resolve, this.params.delay));
console.log(`[DONE] LogTask: ${this.name}`);
return true;
}
}