Skip to content

Commit

Permalink
fix(skymp5-client): prevent profiling file overwrites by adding rando…
Browse files Browse the repository at this point in the history
…m suffix (#2239)
  • Loading branch information
Pospelove authored Dec 2, 2024
1 parent 8072e19 commit 0898981
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion skymp5-client/src/services/services/profilingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0898981

Please sign in to comment.