Lazy initialize sandboxes (workers) upon first need

This commit is contained in:
Zef Hemel
2022-11-01 09:57:20 +01:00
parent a5b8fce3eb
commit 5d9329a531
6 changed files with 40 additions and 18 deletions
+3 -1
View File
@@ -6,7 +6,9 @@ export default function sandboxSyscalls(system: System<any>): SysCallMapping {
"sandbox.getLogs": (): LogEntry[] => {
let allLogs: LogEntry[] = [];
for (const plug of system.loadedPlugs.values()) {
allLogs = allLogs.concat(plug.sandbox.logBuffer);
if (plug.sandbox) {
allLogs = allLogs.concat(plug.sandbox.logBuffer);
}
}
allLogs = allLogs.sort((a, b) => a.date - b.date);
return allLogs;