mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +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: {
|
||||
type: 'default',
|
||||
time: '3s',
|
||||
memory: '256m',
|
||||
},
|
||||
@@ -64,10 +65,11 @@ int main(){
|
||||
return parseInt(a[a.length - 2], 10);
|
||||
}
|
||||
|
||||
const stackPromise = stackSize();
|
||||
let stackPromise;
|
||||
|
||||
export async function get() {
|
||||
const info = await _get();
|
||||
if (!stackPromise) stackPromise = stackSize();
|
||||
// @ts-ignore
|
||||
info.stack = await stackPromise;
|
||||
return info;
|
||||
|
||||
Reference in new issue
Block a user