mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-09-21 00:18:02 +03:00
fix(electron): close db before move db file
This commit is contained in:
parent
c58673c55f
commit
717dd93f37
@ -269,6 +269,8 @@ export async function moveDBFile(
|
||||
};
|
||||
}
|
||||
|
||||
db.db.close();
|
||||
|
||||
if (isLink) {
|
||||
// remove the old link to unblock new link
|
||||
await fs.unlink(db.path);
|
||||
@ -278,8 +280,6 @@ export async function moveDBFile(
|
||||
overwrite: true,
|
||||
});
|
||||
|
||||
db.db.close();
|
||||
|
||||
await fs.ensureSymlink(newFilePath, db.path, 'file');
|
||||
logger.info(`openMoveDBFileDialog symlink: ${realpath} -> ${newFilePath}`);
|
||||
db.reconnectDB();
|
||||
|
Loading…
Reference in New Issue
Block a user