mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
judge: compile: add asyncDispose
This commit is contained in:
3 files changed
+4
-1
No files matched your search
@@ -37,6 +37,7 @@ export default async function compile(
|
||||
execute,
|
||||
copyIn: { ...copyIn, [target]: { fileId: fileIds[target] } },
|
||||
clean: async () => await cleanup(),
|
||||
[Symbol.asyncDispose]: async () => await cleanup(),
|
||||
_cacheable: target,
|
||||
};
|
||||
}
|
||||
@@ -44,5 +45,6 @@ export default async function compile(
|
||||
execute,
|
||||
copyIn: { ...copyIn, [lang.code_file]: code },
|
||||
clean: () => Promise.resolve(null),
|
||||
[Symbol.asyncDispose]: () => Promise.resolve(null),
|
||||
};
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export interface Execute {
|
||||
execute: string;
|
||||
clean: () => Promise<any>;
|
||||
copyIn: Record<string, CopyInFile>;
|
||||
[Symbol.asyncDispose]: () => Promise<any>;
|
||||
_cacheable?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ export class JudgeTask {
|
||||
end: (data: Partial<JudgeResultBody>) => void;
|
||||
env: Record<string, string>;
|
||||
callbackCache?: TestCase[];
|
||||
compileCache: Record<string, Pick<Execute, 'execute' | 'copyIn'>> = {};
|
||||
compileCache: Record<string, Pick<Execute, 'execute' | 'copyIn' | typeof Symbol.asyncDispose>> = {};
|
||||
|
||||
constructor(public session: Session, public request: JudgeRequest) {
|
||||
this.stat.receive = new Date();
|
||||
|
||||
Reference in new issue
Block a user