Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/node/services/experimentsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { getMuxHome } from "@/common/constants/paths";
import type { ExperimentValue } from "@/common/orpc/types";
import { log } from "@/node/services/log";
import type { TelemetryService } from "@/node/services/telemetryService";

import * as fs from "fs/promises";
import writeFileAtomic from "write-file-atomic";
import * as path from "path";

export type { ExperimentValue };
Expand Down Expand Up @@ -298,7 +300,7 @@ export class ExperimentsService {
};

await fs.mkdir(this.muxHome, { recursive: true });
await fs.writeFile(this.cacheFilePath, JSON.stringify(payload, null, 2), "utf-8");
await writeFileAtomic(this.cacheFilePath, JSON.stringify(payload, null, 2), "utf-8");
} catch {
// Ignore cache persistence failures
}
Expand Down