File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ export class Verilog extends Language {
2020 skip : false ,
2121 command : getConfig ( ) . language . xst ,
2222 args : [ "-ifn" , "main.xst" ] ,
23+ spawnOption : {
24+ timeLimit : 60000 ,
25+ } ,
2326 } ;
2427 } ,
2528 } ;
Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ export function hengSpawn(
4343 const subProcess = spawn ( command , args , basicOption ) ;
4444 return Object . assign ( subProcess , {
4545 result : new Promise ( ( resolve , reject ) => {
46- subProcess . on ( "exit " , ( code , signal ) => {
46+ subProcess . on ( "close " , ( code , signal ) => {
4747 let signalNumber = - 1 ;
4848 if ( signal ) {
4949 signalNumber = constants . signals [ signal ] ;
5050 }
5151 resolve ( {
5252 memory : 0 ,
53- returnCode : code ?? 10 ,
53+ returnCode : code ?? 9 ,
5454 signal : signalNumber ,
5555 time : {
5656 real : 0 ,
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ export class NormalJudgeAgent extends JudgeAgent {
371371 const buffer = Buffer . alloc ( output . length ) ;
372372 const start = Date . now ( ) ;
373373 await port . write ( input ) ;
374- const timeout = setTimeout ( closePort , judgeTimeout , port ) ;
374+ setTimeout ( closePort , judgeTimeout , port ) ;
375375 try {
376376 while ( memory < output . length ) {
377377 const { bytesRead } = await port . read (
@@ -389,7 +389,6 @@ export class NormalJudgeAgent extends JudgeAgent {
389389 } catch {
390390 kind = JudgeResultKind . TimeLimitExceeded ;
391391 }
392- clearTimeout ( timeout ) ;
393392 await closePort ( port ) ;
394393 time = Date . now ( ) - start ;
395394 }
You can’t perform that action at this time.
0 commit comments