@@ -50,7 +50,7 @@ async function handleEventGracefully(event, data, err) {
50
50
// reschedule event
51
51
if ( event . retryCount < config . RETRY_COUNT ) {
52
52
logger . debug ( 'Scheduling event for next retry' ) ;
53
- const newEvent = { ...event } ;
53
+ const newEvent = { ...event } ;
54
54
newEvent . retryCount += 1 ;
55
55
delete newEvent . copilot ;
56
56
const timeoutKey = setTimeout ( async ( ) => {
@@ -79,17 +79,15 @@ async function handleEventGracefully(event, data, err) {
79
79
} else if ( event . event === 'issue.created' ) {
80
80
if ( err . name === 'ProcessorError' && err . statusCode && err . message ) {
81
81
// comment for challenge creation failed
82
- comment = `[${ err . statusCode } ]: ${ err . message } `
82
+ comment = `[${ err . statusCode } ]: ${ err . message } ` ;
83
83
} else {
84
84
// comment for challenge creation failed
85
85
comment = 'The challenge creation on the Topcoder platform failed. Please contact support to try again' ;
86
86
}
87
87
} else if ( event . event === 'copilotPayment.add' ) {
88
88
// comment for copilot payment challenge create failed
89
89
comment = 'The copilot payment challenge creation on the Topcoder platform failed. Please contact support to try again' ;
90
- await dbHelper . remove ( models . CopilotPayment , {
91
- id : { eq : data . id }
92
- } ) ;
90
+ await dbHelper . removeCopilotPayment ( models . CopilotPayment , data . id ) ;
93
91
// we dont need to put comment for copilot payment
94
92
return ;
95
93
}
0 commit comments