You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a super WIP impl I made - have to double check if we can Proxy the Deno.cron global like this.
/* eslint-disable deprecation/deprecation */import{withMonitor}from'@sentry/core';importtype{Integration}from'@sentry/types';/** Creates cron . */exportclassDenoCronimplementsIntegration{/** @inheritDoc */publicstaticid='DenoCron';/** @inheritDoc */publicname: string=DenoCron.id;/** @inheritDoc */publicsetupOnce(): void{if('cron'inDeno&&typeofDeno.cron==='function'){Deno.cron=newProxy(Deno.cron,{apply: (cronTarget,cronThisArg,cronArgs: Parameters<typeofDeno.cron>)=>{const[name,schedule]=cronArgs;withMonitor(name,()=>cronTarget.apply(cronThisArg,cronArgs),{// (minutes) so 12 hours - just a very high arbitrary number since we don't know the actual duration of the users cron jobmaxRuntime: 60*12,schedule: {type: 'crontab',value: schedule,},});},});}}}
The API is unstable, so it could change in the future. I don't expect major changes though, other than adding more fields to options (which is non-breaking).
Problem Statement
https://deno.com/blog/cron
https://docs.sentry.io/platforms/node/crons/
Solution Brainstorm
Add instrumentation around
Deno.cron
The text was updated successfully, but these errors were encountered: