mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: sysinfo: only get stack size when needed
This commit is contained in:
1 parent
37e72fa5ae
commit
b17bc16d66
1 file changed
+3
-1
@@ -27,6 +27,7 @@ int main(){
|
|||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
|
type: 'default',
|
||||||
time: '3s',
|
time: '3s',
|
||||||
memory: '256m',
|
memory: '256m',
|
||||||
},
|
},
|
||||||
@@ -64,10 +65,11 @@ int main(){
|
|||||||
return parseInt(a[a.length - 2], 10);
|
return parseInt(a[a.length - 2], 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
const stackPromise = stackSize();
|
let stackPromise;
|
||||||
|
|
||||||
export async function get() {
|
export async function get() {
|
||||||
const info = await _get();
|
const info = await _get();
|
||||||
|
if (!stackPromise) stackPromise = stackSize();
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
info.stack = await stackPromise;
|
info.stack = await stackPromise;
|
||||||
return info;
|
return info;
|
||||||
|
|||||||
Reference in new issue
Block a user