Skip to content

Commit 4f9b8d6

Browse files
committed
Task that logs a lot
1 parent a345ad2 commit 4f9b8d6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

references/v3-catalog/src/trigger/logging.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { task } from "@trigger.dev/sdk/v3";
1+
import { logger, task, wait } from "@trigger.dev/sdk/v3";
22
import slugify from "@sindresorhus/slugify";
33

44
export const loggingTask = task({
@@ -9,3 +9,13 @@ export const loggingTask = task({
99
return null;
1010
},
1111
});
12+
13+
export const lotsOfLogs = task({
14+
id: "lots-of-logs",
15+
run: async (payload: { count: number }) => {
16+
for (let i = 0; i < payload.count; i++) {
17+
logger.info(`Hello world ${i} ${slugify("foo bar")}`);
18+
await wait.for({ seconds: 0.1 });
19+
}
20+
},
21+
});

0 commit comments

Comments
 (0)