Rocky_Mountain_Vending/.pnpm-store/v10/files/82/ef83f3a4cf5d477f47e75980d472728a4f02ae155398d02a2f3c7cf5acc82e8431b9bfcbbce8b6d8c84268916b72dd59bf5fef73370ec26b048e2852d21a39
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

71 lines
2.1 KiB
Text

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const common = require('./common.js');
/**
* Wraps the `node-cron` library with check-in monitoring.
*
* ```ts
* import * as Sentry from "@sentry/node";
* import * as cron from "node-cron";
*
* const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron);
*
* cronWithCheckIn.schedule(
* "* * * * *",
* () => {
* console.log("running a task every minute");
* },
* { name: "my-cron-job" },
* );
* ```
*/
function instrumentNodeCron(lib) {
return new Proxy(lib, {
get(target, prop) {
if (prop === 'schedule' && target.schedule) {
// When 'get' is called for schedule, return a proxied version of the schedule function
return new Proxy(target.schedule, {
apply(target, thisArg, argArray) {
const [expression, callback, options] = argArray;
const name = options?.name;
const timezone = options?.timezone;
if (!name) {
throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.');
}
const monitoredCallback = async () => {
return core.withMonitor(
name,
async () => {
// We have to manually catch here and capture the exception because node-cron swallows errors
// https://github.com/node-cron/node-cron/issues/399
try {
return await callback();
} catch (e) {
core.captureException(e);
throw e;
}
},
{
schedule: { type: 'crontab', value: common.replaceCronNames(expression) },
timezone,
},
);
};
return target.apply(thisArg, [expression, monitoredCallback, options]);
},
});
} else {
return target[prop ];
}
},
});
}
exports.instrumentNodeCron = instrumentNodeCron;
//# sourceMappingURL=node-cron.js.map