From 562638be19ccf2d1b8e799457cbeef9ed7e8a874 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Wed, 30 Oct 2024 10:38:05 +0100 Subject: [PATCH] inline cron decorator config --- .../nestjs/features/sentry-cron-decorator.mdx | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/docs/platforms/javascript/guides/nestjs/features/sentry-cron-decorator.mdx b/docs/platforms/javascript/guides/nestjs/features/sentry-cron-decorator.mdx index 2354b1cc4ac37..ba28e5d7e276a 100644 --- a/docs/platforms/javascript/guides/nestjs/features/sentry-cron-decorator.mdx +++ b/docs/platforms/javascript/guides/nestjs/features/sentry-cron-decorator.mdx @@ -18,22 +18,19 @@ To get started, import `SentryCron` from `@sentry/nestjs` and use it to decorate ```typescript import { Cron } from '@nestjs/schedule'; -import { SentryCron, MonitorConfig } from '@sentry/nestjs'; -import type { MonitorConfig } from '@sentry/types'; - -const monitorConfig: MonitorConfig = { - schedule: { - type: "crontab", - value: "* * * * *", - }, - checkinMargin: 2, // In minutes. Optional. - maxRuntime: 10, // In minutes. Optional. - timezone: "America/Los_Angeles", // Optional. -}; +import { SentryCron } from '@sentry/nestjs'; export class MyCronService { @Cron('* * * * *') - @SentryCron('my-monitor-slug', monitorConfig) + @SentryCron('my-monitor-slug', { + schedule: { + type: "crontab", + value: "* * * * *", + }, + checkinMargin: 2, // In minutes. Optional. + maxRuntime: 10, // In minutes. Optional. + timezone: "America/Los_Angeles", // Optional. + }) handleCron() { // Your cron job logic here }