Skip to content

Commit 3b292c8

Browse files
authored
docs(nestjs): Inline cron decorator config #11682
1 parent 8beed78 commit 3b292c8

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

docs/platforms/javascript/guides/nestjs/features/sentry-cron-decorator.mdx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,19 @@ To get started, import `SentryCron` from `@sentry/nestjs` and use it to decorate
1818

1919
```typescript
2020
import { Cron } from '@nestjs/schedule';
21-
import { SentryCron, MonitorConfig } from '@sentry/nestjs';
22-
import type { MonitorConfig } from '@sentry/types';
23-
24-
const monitorConfig: MonitorConfig = {
25-
schedule: {
26-
type: "crontab",
27-
value: "* * * * *",
28-
},
29-
checkinMargin: 2, // In minutes. Optional.
30-
maxRuntime: 10, // In minutes. Optional.
31-
timezone: "America/Los_Angeles", // Optional.
32-
};
21+
import { SentryCron } from '@sentry/nestjs';
3322

3423
export class MyCronService {
3524
@Cron('* * * * *')
36-
@SentryCron('my-monitor-slug', monitorConfig)
25+
@SentryCron('my-monitor-slug', {
26+
schedule: {
27+
type: "crontab",
28+
value: "* * * * *",
29+
},
30+
checkinMargin: 2, // In minutes. Optional.
31+
maxRuntime: 10, // In minutes. Optional.
32+
timezone: "America/Los_Angeles", // Optional.
33+
})
3734
handleCron() {
3835
// Your cron job logic here
3936
}

0 commit comments

Comments
 (0)