Skip to content

Commit 3534a0b

Browse files
committed
fix: restore template literals lost during PR preparation
1 parent efb93ff commit 3534a0b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

extensions/memory-core/src/memory/manager-atomic-reindex.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ async function renameWithRetry(src: string, dest: string): Promise<void> {
2828
export async function moveMemoryIndexFiles(sourceBase: string, targetBase: string): Promise<void> {
2929
const suffixes = ["", "-wal", "-shm"];
3030
for (const suffix of suffixes) {
31-
const source = ${sourceBase};
32-
const target = ${targetBase};
31+
const source = `${sourceBase}${suffix}`;
32+
const target = `${targetBase}${suffix}`;
3333
try {
3434
await renameWithRetry(source, target);
3535
} catch (err) {
@@ -42,17 +42,17 @@ export async function moveMemoryIndexFiles(sourceBase: string, targetBase: strin
4242

4343
export async function removeMemoryIndexFiles(basePath: string): Promise<void> {
4444
const suffixes = ["", "-wal", "-shm"];
45-
await Promise.all(suffixes.map((suffix) => fs.rm(${basePath}, { force: true })));
45+
await Promise.all(suffixes.map((suffix) => fs.rm(`${basePath}${suffix}`, { force: true })));
4646
}
4747

4848
export async function swapMemoryIndexFiles(targetPath: string, tempPath: string): Promise<void> {
49-
const backupPath = ${targetPath}.backup-;
49+
const backupPath = `${targetPath}.backup-${randomUUID()}`;
5050
await moveMemoryIndexFiles(targetPath, backupPath);
5151
try {
5252
await moveMemoryIndexFiles(tempPath, targetPath);
5353
} catch (err) {
5454
await moveMemoryIndexFiles(backupPath, targetPath);
55-
throw err;
55+
thror err;
5656
}
5757
await removeMemoryIndexFiles(backupPath);
5858
}

0 commit comments

Comments
 (0)