MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / fsyncDirectory

Function fsyncDirectory

apps/local/src/db/v1-v2-migration.ts:1081–1093  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1079};
1080
1081const fsyncDirectory = (path: string): void => {
1082 try {
1083 const fd = fs.openSync(path, "r");
1084 try {
1085 fs.fsyncSync(fd);
1086 } finally {
1087 fs.closeSync(fd);
1088 }
1089 } catch {
1090 // Some platforms/filesystems do not allow fsync on directories. The rename
1091 // still happened; this is best-effort durability hardening.
1092 }
1093};
1094
1095const fsyncSqliteFileSet = (path: string): void => {
1096 for (const suffix of fileSetSuffixes) fsyncFileIfExists(`${path}${suffix}`);

Callers 9

moveSqliteFileSetFunction · 0.85
copySqliteFileSetFunction · 0.85
writeMigrationJournalFunction · 0.85
removeMigrationJournalFunction · 0.85
restoreAuthFromJournalFunction · 0.85
cleanupSecretBackupsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected