From 0898981e8405fe0f057c26fbafe04e4f5834d18b Mon Sep 17 00:00:00 2001 From: Leonid Pospelov Date: Mon, 2 Dec 2024 20:07:26 +0500 Subject: [PATCH] fix(skymp5-client): prevent profiling file overwrites by adding random suffix (#2239) --- skymp5-client/src/services/services/profilingService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skymp5-client/src/services/services/profilingService.ts b/skymp5-client/src/services/services/profilingService.ts index 9f2a9c320d..21967fe252 100644 --- a/skymp5-client/src/services/services/profilingService.ts +++ b/skymp5-client/src/services/services/profilingService.ts @@ -62,7 +62,8 @@ export class ProfilingService extends ClientListener { }); }); - fs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile)); + const fileNameSuffix = Math.random().toString().replace(".0", ""); + fs.writeFileSync(`./profile${fileNameSuffix}.cpuprofile`, JSON.stringify(profile)); } private getInteger(value: unknown) {