This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -431,9 +431,11 @@ async function handleIssueClose(event, issue) { // eslint-disable-line
431
431
432
432
if ( closeChallenge ) {
433
433
logger . debugWithContext ( `The associated challenge ${ dbIssue . challengeUUID } is being scheduled for cancellation since no payment will be given` ,
434
- event , issue ) ;
435
- // Currently, there is no working API for closing challenge.
436
- // The process is just ignored.
434
+ event , issue ) ;
435
+ await dbHelper . update ( models . Issue , dbIssue . id , {
436
+ status : constants . ISSUE_STATUS . CHALLENGE_CANCELLED ,
437
+ updatedAt : new Date ( )
438
+ } ) ;
437
439
return ;
438
440
}
439
441
@@ -525,6 +527,9 @@ async function handleIssueClose(event, issue) { // eslint-disable-line
525
527
// activate challenge
526
528
if ( challenge . status === 'Draft' ) {
527
529
await topcoderApiHelper . activateChallenge ( dbIssue . challengeUUID ) ;
530
+ //HACK - sleep 30 seconds so the legacy processor has time to "catch up"
531
+ logger . debugWithContext ( 'Sleeping for 30 seconds after activation so everything propagates...' , event , issue ) ;
532
+ await new Promise ( resolve => setTimeout ( resolve , 30000 ) ) ;
528
533
}
529
534
530
535
logger . debugWithContext ( `Closing challenge with winner ${ assigneeMember . topcoderUsername } (${ winnerId } )` , event , issue ) ;
You can’t perform that action at this time.
0 commit comments