File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/node-core/src/cron Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ export interface NodeCronOptions {
77}
88
99export interface NodeCron {
10- schedule : ( cronExpression : string , callback : ( ) => void , options : NodeCronOptions | undefined ) => unknown ;
10+ schedule : (
11+ cronExpression : string ,
12+ callback : ( context ?: unknown ) => void ,
13+ options : NodeCronOptions | undefined ,
14+ ) => unknown ;
1115}
1216
1317/**
@@ -44,14 +48,14 @@ export function instrumentNodeCron<T>(lib: Partial<NodeCron> & T): T {
4448 throw new Error ( 'Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.' ) ;
4549 }
4650
47- const monitoredCallback = async ( ) : Promise < void > => {
51+ const monitoredCallback = async ( ... args : Parameters < typeof callback > ) : Promise < void > => {
4852 return withMonitor (
4953 name ,
5054 async ( ) => {
5155 // We have to manually catch here and capture the exception because node-cron swallows errors
5256 // https://github.com/node-cron/node-cron/issues/399
5357 try {
54- return await callback ( ) ;
58+ return await callback ( ... args ) ;
5559 } catch ( e ) {
5660 captureException ( e , {
5761 mechanism : {
You can’t perform that action at this time.
0 commit comments