move updater to fsync so its fully committed to disk before relaunching (#565)
This commit is contained in:
parent
aae50c46f7
commit
dfab53d188
1 changed files with 5 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ import { fetchBuffer, fetchJson } from "@main/utils/http";
|
|||
import { IpcEvents } from "@shared/IpcEvents";
|
||||
import { VENCORD_USER_AGENT } from "@shared/vencordUserAgent";
|
||||
import { ipcMain } from "electron";
|
||||
import { writeFileSync as originalWriteFileSync } from "original-fs";
|
||||
import { closeSync, fsyncSync, openSync, writeFileSync as originalWriteFileSync } from "original-fs";
|
||||
|
||||
import gitHash from "~git-hash";
|
||||
import gitRemote from "~git-remote";
|
||||
|
|
@ -74,6 +74,10 @@ async function applyUpdates() {
|
|||
const data = await fetchBuffer(PendingUpdate);
|
||||
originalWriteFileSync(__dirname, data);
|
||||
|
||||
const fd = openSync(__dirname, "r");
|
||||
fsyncSync(fd);
|
||||
closeSync(fd);
|
||||
|
||||
PendingUpdate = null;
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue