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

Function moveSqliteFileSet

apps/local/src/db/v1-v2-migration.ts:1099–1110  ·  view source on GitHub ↗
(source: string, target: string)

Source from the content-addressed store, hash-verified

1097};
1098
1099const moveSqliteFileSet = async (source: string, target: string): Promise<void> => {
1100 await renameWithRetry(source, target);
1101 fsyncDirectory(dirname(target));
1102 for (const suffix of ["-wal", "-shm"] as const) {
1103 if (fs.existsSync(`${source}${suffix}`)) {
1104 await renameWithRetry(`${source}${suffix}`, `${target}${suffix}`);
1105 fsyncDirectory(dirname(target));
1106 } else {
1107 await rmWithRetry(`${target}${suffix}`);
1108 }
1109 }
1110};
1111
1112const moveExistingSqliteFileSet = async (source: string, target: string): Promise<void> => {
1113 for (const suffix of fileSetSuffixes) {

Callers 1

completeJournaledFlipFunction · 0.85

Calls 3

renameWithRetryFunction · 0.85
fsyncDirectoryFunction · 0.85
rmWithRetryFunction · 0.85

Tested by

no test coverage detected