@@ -51,7 +51,7 @@ export class JudgeTask {
5151 logger . debug ( '%o' , request ) ;
5252 }
5353
54- private startChildSpan ( name : string , attributes ?: Record < string , any > ) {
54+ startChildSpan ( name : string , attributes ?: Record < string , any > ) {
5555 const span = this . tracer . startSpan ( name , { attributes } , this . mainContext ) ;
5656 span [ Symbol . dispose ] = ( ) => span . end ( ) ;
5757 return span as typeof span & { [ Symbol . dispose ] : ( ) => void } ;
@@ -142,13 +142,14 @@ export class JudgeTask {
142142 const allFilesToRemove = Object . keys ( etags ) . filter ( ( name ) => ! allFiles . has ( name ) && fs . existsSync ( join ( filePath , name ) ) ) ;
143143 await Promise . all ( allFilesToRemove . map ( ( name ) => fs . remove ( join ( filePath , name ) ) ) ) ;
144144 if ( filenames . length ) {
145- span . setAttribute ( 'syncedFiles ' , filenames . length ) ;
145+ span . setAttribute ( 'files ' , filenames ) ;
146146 logger . info ( `Getting problem data: ${ this . session ?. config . host || 'local' } /${ source } ` ) ;
147147 this . next ( { message : 'Syncing testdata, please wait...' } ) ;
148+ this . mainContext = trace . setSpan ( context . active ( ) , span ) ;
148149 await this . session . fetchFile ( source , Object . fromEntries (
149150 files . filter ( ( i ) => filenames . includes ( i . name ) )
150151 . map ( ( i ) => [ i . name , join ( filePath , i . name ) ] ) ,
151- ) ) ;
152+ ) , this ) ;
152153 this . compileCache = { } ;
153154 }
154155 if ( allFilesToRemove . length || filenames . length ) {
@@ -161,14 +162,15 @@ export class JudgeTask {
161162 logger . warn ( 'CacheOpen Fail: %s %o %o' , source , files , e ) ;
162163 throw e ;
163164 } finally {
165+ this . mainContext = trace . setSpan ( context . active ( ) , this . span ) ;
164166 Lock . release ( filePath ) ;
165167 }
166168 }
167169
168170 async doSubmission ( ) {
169171 this . folder = await this . cacheOpen ( this . source , this . data ) ;
170172 if ( this . files ?. code ) {
171- const target = await this . session . fetchFile ( null , { [ this . files . code ] : '' } ) ;
173+ const target = await this . session . fetchFile ( null , { [ this . files . code ] : '' } , this ) ;
172174 this . code = { src : target } ;
173175 this . clean . push ( ( ) => fs . remove ( target ) ) ;
174176 }
0 commit comments