MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / runAnalysis

Method runAnalysis

packages/hydrojudge/src/task.ts:292–317  ·  view source on GitHub ↗
(execute: Execute, input: CopyInFile)

Source from the content-addressed store, hash-verified

290 }
291
292 async runAnalysis(execute: Execute, input: CopyInFile) {
293 const langConfig = this.session.getLang(this.lang);
294 if (!langConfig.analysis) return;
295 using span = this.startChildSpan('judge.runAnalysis', { lang: this.lang });
296 try {
297 const r = await runQueued(langConfig.analysis, {
298 copyIn: {
299 ...execute.copyIn,
300 input,
301 [langConfig.code_file || 'foo']: this.code,
302 compile: { content: langConfig.compile || '' },
303 execute: { content: langConfig.execute || '' },
304 },
305 env: this.env,
306 time: 5000,
307 memory: 256,
308 }, `analysis[${this.lang}]<${this.rid}>`, 5);
309 const out = r.stdout.toString();
310 if (out.length) this.next({ compilerText: out.substring(0, 1024) });
311 if (process.env.DEV) console.log(r);
312 } catch (e) {
313 span.recordException(e);
314 logger.info('Failed to run analysis');
315 logger.error(e);
316 }
317 }
318}

Callers 2

judgeCaseFunction · 0.80
judgeCaseFunction · 0.80

Calls 7

startChildSpanMethod · 0.95
runQueuedFunction · 0.90
logMethod · 0.80
getLangMethod · 0.45
nextMethod · 0.45
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected