Skip to content

Commit ad966ea

Browse files
committed
[server] catch cpuprofile write error
1 parent b8c37bd commit ad966ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/server/src/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ process.on("SIGUSR1", () => {
7777
if (!err) {
7878
const filename = path.join(os.tmpdir(), Date.now() + '.cpuprofile');
7979
console.log('preparing cpuprofile: ' + filename);
80-
fs.promises.writeFile(filename, JSON.stringify(profile));
80+
fs.promises.writeFile(filename, JSON.stringify(profile)).catch(err => console.error("error writing cpuprofile", err));
8181
} else {
8282
console.error('failed to cpuprofile: ', err);
8383
}

0 commit comments

Comments
 (0)