mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
@@ -141,6 +141,18 @@ export class SQLiteAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
async checkpoint() {
|
||||
try {
|
||||
if (!this.db) {
|
||||
logger.warn(`${this.path} is not connected`);
|
||||
return;
|
||||
}
|
||||
await this.db.checkpoint();
|
||||
} catch (error) {
|
||||
logger.error('checkpoint', error);
|
||||
}
|
||||
}
|
||||
|
||||
async getUpdatesCount(docId?: string) {
|
||||
try {
|
||||
if (!this.db) {
|
||||
|
||||
@@ -120,6 +120,10 @@ export class WorkspaceSQLiteDB {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
async checkpoint() {
|
||||
await this.adapter.checkpoint();
|
||||
}
|
||||
}
|
||||
|
||||
export async function openWorkspaceDatabase(
|
||||
|
||||
@@ -77,6 +77,7 @@ export async function saveDBFileAs(
|
||||
): Promise<SaveDBFileResult> {
|
||||
try {
|
||||
const db = await ensureSQLiteDB('workspace', workspaceId);
|
||||
await db.checkpoint(); // make sure all changes (WAL) are written to db
|
||||
const fakedResult = getFakedResult();
|
||||
|
||||
const ret =
|
||||
|
||||
@@ -98,8 +98,6 @@ export const registerUpdater = async () => {
|
||||
channel: buildType,
|
||||
});
|
||||
|
||||
logger.debug('auto-updater feed config', feedUrl);
|
||||
|
||||
autoUpdater.setFeedURL(feedUrl);
|
||||
|
||||
// register events for checkForUpdates
|
||||
|
||||
Reference in New Issue
Block a user