mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 16:16:02 +00:00
18 lines
447 B
TypeScript
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;
|
|
}
|
|
}
|