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

Function moveExistingSqliteFileSet

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

Source from the content-addressed store, hash-verified

1110};
1111
1112const moveExistingSqliteFileSet = async (source: string, target: string): Promise<void> => {
1113 for (const suffix of fileSetSuffixes) {
1114 const from = `${source}${suffix}`;
1115 if (!fs.existsSync(from)) continue;
1116 const to = `${target}${suffix}`;
1117 if (fs.existsSync(to)) {
1118 await rmWithRetry(from);
1119 } else {
1120 await renameWithRetry(from, to);
1121 fsyncDirectory(dirname(to));
1122 }
1123 }
1124};
1125
1126const copySqliteFileSet = (source: string, target: string): void => {
1127 removeSqliteFileSet(target);

Callers 1

completeJournaledFlipFunction · 0.85

Calls 3

rmWithRetryFunction · 0.85
renameWithRetryFunction · 0.85
fsyncDirectoryFunction · 0.85

Tested by

no test coverage detected