This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 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
431431
432432 if ( closeChallenge ) {
433433 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+ } ) ;
437439 return ;
438440 }
439441
@@ -525,6 +527,9 @@ async function handleIssueClose(event, issue) { // eslint-disable-line
525527 // activate challenge
526528 if ( challenge . status === 'Draft' ) {
527529 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 ) ) ;
528533 }
529534
530535 logger . debugWithContext ( `Closing challenge with winner ${ assigneeMember . topcoderUsername } (${ winnerId } )` , event , issue ) ;
You can’t perform that action at this time.
0 commit comments