Skip to content

Commit 7c27dab

Browse files
committed
Mitigate memory increasing usage
1 parent 8a2db38 commit 7c27dab

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

server/.vscode/launch.json

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"name": "Launch Program",
88
"skipFiles": ["<node_internals>/**"],
99
"program": "${workspaceFolder}/dist/server.js",
10+
"args": ["--inspect-brk"],
11+
"env": {
12+
"NAIS_CLUSTER_NAME": "local"
13+
},
1014
"cwd": "${workspaceFolder}"
1115
}
1216
]

server/src/nav-dekoratoren/nav-dekoratoren.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ const fetchDecorator = async (url: string, props: DecoratorFetchProps, retries =
2727
disableJavaScriptEvaluation: true,
2828
},
2929
});
30-
window.document.write(html);
3130
const { document } = window;
3231

32+
document.write(html);
33+
3334
const styles = document.getElementById('styles')?.innerHTML;
3435
if (!styles) {
3536
throw new Error('Decorator styles element not found!');
@@ -57,6 +58,9 @@ const fetchDecorator = async (url: string, props: DecoratorFetchProps, retries =
5758
DECORATOR_FOOTER: footer.trim(),
5859
};
5960

61+
document.close();
62+
window.close();
63+
6064
return elements;
6165
})
6266
.catch((e) => {

0 commit comments

Comments
 (0)