Skip to content

Commit 7be1f9b

Browse files
committed
change
1 parent deedef4 commit 7be1f9b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

frontend/src/instrumentation.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import fs from "fs";
1+
export async function register() {
2+
if (
3+
process.env.NEXT_RUNTIME === "nodejs" &&
4+
process.env.NEXT_MANUAL_SIG_HANDLE
5+
) {
6+
const fs = await import("fs");
27

3-
export function register() {
4-
if (process.env.NEXT_RUNTIME === "nodejs") {
5-
if (process.env.NEXT_MANUAL_SIG_HANDLE) {
6-
process.on("SIGTERM", () => {
7-
fs.writeFileSync("/tmp/shutdown", "1");
8-
});
9-
}
8+
process.on("SIGTERM", () => {
9+
fs.writeFileSync("/tmp/shutdown", "1");
10+
});
1011
}
1112
}

0 commit comments

Comments
 (0)